Valentin3526 Posted August 7, 2015 Share Posted August 7, 2015 (edited) Hi I have a error in my script, the debugscript send me "WARNING: Scripts\interact.lua:29: Bad argument 'getElementType' [Expected element at argument 1, got nil]" this is in this par of my script: function markerCol ( marker ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then --LINE 29 (ERROR HERE) guitank1() guiSetVisible(gui,true) showCursor(true) outputConsole("réussi") else outputConsole("erreur") end end addEventHandler( "onClientMarkerHit", marker, markerCol ) I can send you may all script (clientside): -- spawn tank 1 function guitank1() gui = guiCreateWindow(0.25,0.25,0.5,0.13,"Contrôle du garage",true) guiSetAlpha(gui,1) button1 = guiCreateButton(0,70,900,20,"Fermer la fenêtre",false,gui) guiSetAlpha(button1,1) addEventHandler("onClientGUIClick", button1, closeguispawntank1) button2 = guiCreateButton(0,20,900,20,"Ouvrir le garage",false,gui) guiSetAlpha(button1,1) addEventHandler("onClientGUIClick", button2, opendoor1) button3 = guiCreateButton(0,45,900,20,"Fermer le garage",false,gui) guiSetAlpha(button1,1) addEventHandler("onClientGUIClick", button3, closedoor1) end function closeguispawntank1 () guiSetVisible(gui,false) showCursor(false) end marker = createMarker ( -692.20001, 959.29999, 11.2, "cylinder", 1, 255, 100, 100, 255 ) keypad = createObject ( 2886, -692.20001, 959.70001, 13 ) door = createObject ( 3037, -693.40002, 966.5, 13.4 ) function markerCol ( marker ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guitank1() guiSetVisible(gui,true) showCursor(true) outputConsole("réussi") else outputConsole("erreur") end end addEventHandler( "onClientMarkerHit", marker, markerCol ) function opendoor1 () moveObject (door, 60000, -693.40002, 966.5, 0) end function closedoor1 () moveObject (door, 5000, -693.40002, 966.5, 13.4) end how can I fix it ? PS: I can't open the GUI Edited August 7, 2015 by Guest Link to comment
Simple. Posted August 7, 2015 Share Posted August 7, 2015 function markerCol ( hitElement ) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then --LINE 29 (ERROR HERE) guitank1() guiSetVisible(gui,true) showCursor(true) outputConsole("réussi") else outputConsole("erreur") end end addEventHandler( "onClientMarkerHit", marker, markerCol ) Try Link to comment
Valentin3526 Posted August 7, 2015 Author Share Posted August 7, 2015 Thanks for help Link to comment
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