toptional Posted March 2, 2013 Posted March 2, 2013 Getting this error no idea why addEventHandler("test", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, GUIEditor.window[1]) end ) function jetpackPanel(keyPresser) if guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false, false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true, true) end end bindKey("f9", "down", GUIEditor.window[1]) I get this error ERROR: AJetPack\client.lua:20: attempt to index global 'GUIEditor' (a nil value)
manve1 Posted March 2, 2013 Posted March 2, 2013 gui editor scripts need a table (( not sure why )), but for some reason when you use gui editor, u must re-name windows, memos, ect ... or add the tables (( if you know what i mean )) Looking for tutorials or information? check out: www.simpleask.co.uk
DNL291 Posted March 2, 2013 Posted March 2, 2013 addEventHandler("onClientResourceStart", resourceRoot, function() myWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(myWindow, false) guiSetVisible(myWindow,false) JetpackButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, myWindow) end ) function jetpackPanel(keyPresser) if guiGetVisible(myWindow) then guiSetVisible(myWindow, false) showCursor(false, false) else guiSetVisible(myWindow, true) showCursor(true, true) end end bindKey("f9", "down", jetpackPanel) Please do not PM me with scripting related question nor support, use the forums instead.
toptional Posted March 2, 2013 Author Posted March 2, 2013 addEventHandler("onClientResourceStart", resourceRoot, function() myWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(myWindow, false) guiSetVisible(myWindow,false) JetpackButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, myWindow) end ) function jetpackPanel(keyPresser) if guiGetVisible(myWindow) then guiSetVisible(myWindow, false) showCursor(false, false) else guiSetVisible(myWindow, true) showCursor(true, true) end end bindKey("f9", "down", jetpackPanel) I get this error WARNING: Bad Arguement @ 'bindKey'
xXMADEXx Posted March 2, 2013 Posted March 2, 2013 GUIEditor = { button = {} } addEventHandler("test", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, GUIEditor.window[1]) end ) function jetpackPanel(keyPresser) if guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false, false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true, true) end end bindKey("f9", "down", GUIEditor.window[1]) The Ultimate Lua Tutorial! | MTA PHP SDK
toptional Posted March 2, 2013 Author Posted March 2, 2013 GUIEditor = { button = {} } addEventHandler("test", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, GUIEditor.window[1]) end ) function jetpackPanel(keyPresser) if guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false, false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true, true) end end bindKey("f9", "down", GUIEditor.window[1]) Getting this error ERROR: AJetpack\client.lua:22: attempt to index field 'window' (a nil value)
denny199 Posted March 2, 2013 Posted March 2, 2013 (edited) GUIEditor.window = {} GUIEditor.button = {} addEvent("test", true ) -- You forget the event addEventHandler("test", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, GUIEditor.window[1]) end ) bindKey("f9", "down", function () if guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false, false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true, true) end end) @manve You need to add those tables because you are storing it in the table, because when you are making 2 GUI's in GUIeditor, it will create number "2" instead of number "1" Edited March 2, 2013 by Guest Sometimes I dream about cheese
toptional Posted March 2, 2013 Author Posted March 2, 2013 GUIEditor.window = {} GUIEditor.button = {} addEvent("test", true ) -- You forget the event addEventHandler("test", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, GUIEditor.window[1]) end ) wtf? That's not helping... bindKey("f9", "down", function () if guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor(false, false) else guiSetVisible(GUIEditor.window[1], true) showCursor(true, true) end end) @manve You need to add those tables because you are storing it in the table, because when you are making 2 GUI's in GUIeditor, it will create number "2" instead of number "1"
iPrestege Posted March 2, 2013 Posted March 2, 2013 function GUI() theWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(theWindow, false) theButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, theWindow) end addEvent("test",true) addEventHandler("onClientResourceStart",resourceRoot,GUI) addEventHandler("test",resourceRoot,GUI) bindKey ("f9", "down", function() guiSetVisible(theWindow, not guiGetVisible(theWindow)) showCursor(guiGetVisible(theWindow)) end )
toptional Posted March 2, 2013 Author Posted March 2, 2013 function GUI() theWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(theWindow, false) theButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, theWindow) end addEvent("test",true) addEventHandler("onClientResourceStart",resourceRoot,GUI) addEventHandler("test",resourceRoot,GUI) bindKey ("f9", "down", function() guiSetVisible(theWindow, not guiGetVisible(theWindow)) showCursor(guiGetVisible(theWindow)) end ) Got this error WARNING: AJetPack\client.lua:12: Bad Argument @ 'bindKey'
PaiN^ Posted March 2, 2013 Posted March 2, 2013 function GUI() theWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(theWindow, false) theButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, theWindow) end addEvent("test",true) addEventHandler("onClientResourceStart",resourceRoot,GUI) addEventHandler("test",resourceRoot,GUI) function openWin() if guiGetVisible(theWindow) then guiSetVisible(theWindow, false) showCursor(false) else guiSetVisible(theWindow, true) showCursor(true) end end bindKey("F9", "down", openWin) " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
DNL291 Posted March 2, 2013 Posted March 2, 2013 addEventHandler("onClientResourceStart", resourceRoot, function() myWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(myWindow, false) guiSetVisible(myWindow,false) JetpackButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, myWindow) end ) function jetpackPanel(keyPresser) if guiGetVisible(myWindow) then guiSetVisible(myWindow, false) showCursor(false, false) else guiSetVisible(myWindow, true) showCursor(true, true) end end bindKey("f9", "down", jetpackPanel) I get this error WARNING: Bad Arguement @ 'bindKey' Because the key is "F9" and not "f9". Please do not PM me with scripting related question nor support, use the forums instead.
toptional Posted March 2, 2013 Author Posted March 2, 2013 I tried it with F9 and f9 still getting the same error WARNING: AJetPack\client.lua:20: Bad Argument @ 'bindKey'
DNL291 Posted March 2, 2013 Posted March 2, 2013 Well, I tested and it worked for me. Please do not PM me with scripting related question nor support, use the forums instead.
PaiN^ Posted March 2, 2013 Posted March 2, 2013 I'm sure that there is another part of the script causing this .. " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
toptional Posted March 3, 2013 Author Posted March 3, 2013 Ops, just realized i f'd up the meta.xml lol thanks for your help Edit my problem is The gui shows on startup and closes with F5 but i don't want it to show on start up code: function GUI() theWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(theWindow, false) theButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, theWindow) end addEvent("test",true) addEventHandler("onClientResourceStart",resourceRoot,GUI) addEventHandler("test",resourceRoot,GUI) function openWin() if guiGetVisible(theWindow) then guiSetVisible(theWindow, false) showCursor(false) else guiSetVisible(theWindow, true) showCursor(true) end end bindKey("F5", "down", openWin)
gokalpfirat Posted March 3, 2013 Posted March 3, 2013 theWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(theWindow, false) theButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, theWindow) guiSetVisible(theWindow,false) function openWin() if guiGetVisible(theWindow) then guiSetVisible(theWindow, false) showCursor(false) else guiSetVisible(theWindow, true) showCursor(true) end end bindKey("F5", "down", openWin) Try this.
toptional Posted March 3, 2013 Author Posted March 3, 2013 theWindow = guiCreateWindow(420, 210, 433, 320, "Jetpack giver By Robbster", false) guiWindowSetSizable(theWindow, false) theButton = guiCreateButton(122, 123, 188, 87, "Give yourself Jetpack", false, theWindow) guiSetVisible(theWindow,false) function openWin() if guiGetVisible(theWindow) then guiSetVisible(theWindow, false) showCursor(false) else guiSetVisible(theWindow, true) showCursor(true) end end bindKey("F5", "down", openWin) Try this. Thanks it works!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now