Writing an LUA script for portals menu

User Tag List

Results 1 to 7 of 7
  1. #1
    ledz14's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    82
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Writing an LUA script for portals



    OK, all of this LUA scripting talk sounds hard, so I'm gonna break it down for you.

    First, we'll need a Gameobject to serve as a portal. You can use the folowing SQL querry as a base.

    Code:

    INSERT INTO gameobject_names_copy
    (`entry`, `Type`, `DisplayID`, `Name`, `spellfocus`, `sound1`, `sound2`, `sound3`, `sound4`, `sound5`, `sound6`, `sound7`, `sound8`, `sound9`, `unknown1`, `unknown2`, `unknown3`, `unknown4`, `unknown5`, `unknown6`, `unknown7`, `unknown8`, `unknown9`, `unknown10`, `unknown11`, `unknown12`, `unknown13`, `unknown14`)
    VALUES
    (2, 1, 4396, 'Gurubashi Arena Portal', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);






    Now, lets make a new Lua script. Since we're making a portal to Gurubashi Arena, lets call it "arenaportal.lua". The name doesn't realy matter, just as long it's a .lua file.

    Copy and paste the folowing piece of Lua code in the file. You might want to adjust the information to correspond to your Gameobject, and ofcourse your location (type .gps ingame for the coordinates).

    If you're taking the coordinates from the recall table in your Ascent world database be SURE to replace their commas by dots. If not, this'll cause function overflow.


    Code:
    function gurubashiarena(pGameObject, event, pMisc)
    pMisc:Teleport(0, -13228.470703, 227.919037, 32.869213)
    end

    RegisterUnitEvent(2, 2, "gurubashiarena")


    Code Breakdown time!

    RegisterUnitEvent(2, 2, "gurubashiarena") :: This is the "Reigsterevent". Replace the FIRST '2' by your Gameobject Id.

    function gurubashiarena(pGameObject, event, pMisc) :: This defines the function. It's the header that tells Ascent the function named "gurubashiarena" starts here.

    pMisc:Teleport(0, -13228.470703, 227.919037, 32.869213) :: Teleports in this order: mapid, x, y, z, orientation.

    end :: Tells Ascent the function "gurubashiarena" stops here.

    Thanks for your time, hope this helps.

    -Ledz

    Writing an LUA script for portals
  2. #2
    Flapjack89's Avatar Corporal
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hope this works first post WOOT!!!!

  3. #3
    Flapjack89's Avatar Corporal
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    um...where do i save the Lua script file in my ascent folder and scripts??

  4. #4
    phillipwow's Avatar Member
    Reputation
    8
    Join Date
    Apr 2008
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohh thanks thats dont has help me

  5. #5
    Flamehaze's Avatar Member
    Reputation
    1
    Join Date
    Jul 2008
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Flapjack89 View Post
    um...where do i save the Lua script file in my ascent folder and scripts??
    Yes right into your scripts folder , Sweet guide

  6. #6
    Skype's Avatar Member
    Reputation
    133
    Join Date
    Dec 2007
    Posts
    116
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.mmowned.com/forums/emulat...a-portals.html

    You broke the first rule of MMOwned.


  7. #7
    Cursed's Avatar Contributor
    Reputation
    270
    Join Date
    Jun 2007
    Posts
    1,380
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gastric already made a guide for this....

Similar Threads

  1. Replies: 2
    Last Post: 06-01-2010, 05:29 AM
  2. [LUA Scripting] For Beginners 1.0
    By Blackheat in forum WoW EMU Guides & Tutorials
    Replies: 18
    Last Post: 06-25-2009, 07:42 AM
  3. Lua Script For a Checkpoint Tele
    By shadowslayer133 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 02-12-2009, 05:07 PM
  4. Replies: 9
    Last Post: 06-19-2008, 03:55 AM
  5. LUA scripting. For noobs.
    By Locky in forum WoW EMU Guides & Tutorials
    Replies: 17
    Last Post: 06-05-2008, 02:12 PM
All times are GMT -5. The time now is 02:57 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search