Eddy32HD Posted December 3, 2016 Share Posted December 3, 2016 Server Log ~ [22:38:39] Starting movinggate [22:38:39] WARNING: movinggate\server.lua:6: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] [22:38:39] movinggate restarted successfully [22:38:45] WARNING: movinggate\server.lua:11: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] Script Code ~ Object = createObject(968, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) Marker = createMarker(1551.0999755859, -1627.3000488281, 12.5, "cylinder", 2, 100, 0, 12.5, 100) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 0, 90) end addEventHandler("onMarkerHit",gateo) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) end addEventHandler("onMarkerLeave",gateo) Please help me solve this "addEventHandler" Problem. I'm new to the scripting,, Ive tried my research but i dont get it. Link to comment
Mrzeerox Posted December 3, 2016 Share Posted December 3, 2016 Object = createObject(968, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) Marker = createMarker(1551.0999755859, -1627.3000488281, 12.5, "cylinder", 2, 100, 0, 12.5, 100) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 0, 90) end addEventHandler("onMarkerHit",gateo) function gateoback(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) end addEventHandler("onMarkerLeave",gateoback) Try this Link to comment
Eddy32HD Posted December 3, 2016 Author Share Posted December 3, 2016 3 minutes ago, alvarkiis said: Object = createObject(968, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) Marker = createMarker(1551.0999755859, -1627.3000488281, 12.5, "cylinder", 2, 100, 0, 12.5, 100) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 0, 90) end addEventHandler("onMarkerHit",gateo) function gateoback(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) end addEventHandler("onMarkerLeave",gateoback) Try this Didn't work. Still same error code Server Log ~ [23:05:10] WARNING: movinggate\server.lua:6: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] [23:05:10] WARNING: movinggate\server.lua:11: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] Link to comment
Eddy32HD Posted December 3, 2016 Author Share Posted December 3, 2016 (edited) I resolved This part [23:05:10] WARNING: movinggate\server.lua:6: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] [23:05:10] WARNING: movinggate\server.lua:11: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] By adding "root" to "addEventHandler("onMarkerHit", root, gateo)" Both Object = createObject(968, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) Marker = createMarker(1551.0999755859, -1627.3000488281, 12.5, "cylinder", 2, 100, 0, 12.5, 100) function gateo(player) moveObject(object, 1546.1999511719, -1631, 13.39999961853, 0, 0, 90) end addEventHandler("onMarkerHit", root, gateo) function gateoback(player) moveObject(object, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) end addEventHandler("onMarkerLeave",root, gateoback) But now, I have a new Error Warning by the server Log. Error ~ [23:40:27] WARNING: movinggate\server.lua:9: Bad argument @ 'moveObject' [Expected element at argument 1, got nil] [23:41:18] WARNING: movinggate\server.lua:4: Bad argument @ 'moveObject' [Expected element at argument 1, got nil] Edited December 3, 2016 by Eddy32HD Link to comment
DerbyDash Posted December 3, 2016 Share Posted December 3, 2016 (edited) object and Object is completely different thing for programming languages So you should make it same Edited December 3, 2016 by DerbyDash Link to comment
Eddy32HD Posted December 3, 2016 Author Share Posted December 3, 2016 2 minutes ago, DerbyDash said: object and Object is completely different thing for programming languages So you should make it same WOW! Thank you very much!! Link to comment
Eddy32HD Posted December 3, 2016 Author Share Posted December 3, 2016 Topic Closed. Thank you guys! Link to comment
Dimos7 Posted December 3, 2016 Share Posted December 3, 2016 Object = createObject(968, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) Marker = createMarker(1551.0999755859, -1627.3000488281, 12.5, "cylinder", 2, 100, 0, 12.5, 100) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 0, 90) end addEventHandler("onMarkerHit",Marker,gateo) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) end addEventHandler("onMarkerLeave",Marker,gateo) 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