Moderators IIYAMA Posted February 13, 2013 Moderators Posted February 13, 2013 I am confused, yesterday I made like 5 working triggers, but today I can't find what is wrong... 0 errors or warnings... --client function addCommand() outputChatBox("1") local object = createElement("flag") triggerServerEvent ("addObjectExpl",getLocalPlayer(),object) --triggerServerEvent ("addObjectExpl",localPlayer,object) end addCommandHandler ("lol", addCommand) --server local objectExpl = {} local objectExplTimer function addToObjectExpl (object) outputChatBox("2") table.insert(objectExpl,{object,20}) if not isTimer (objectExplTimer) then objectExplTimer = setTimer (objectTimer,500,0) end end addEvent("addObjectExpl", true) addEventHandler("addObjectExpl", getRootElement(), addToObjectExpl) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Anderl Posted February 13, 2013 Posted February 13, 2013 And what's the problem? "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Cadu12 Posted February 13, 2013 Posted February 13, 2013 When you create element for client and send to server-side, it wont work. Ingame nick: Cadu12
Moderators IIYAMA Posted February 13, 2013 Author Moderators Posted February 13, 2013 lol this is the problem: local object = createElement("flag") Some how this object does not have user data.... but when I trigger this, nothing will happen, not even "you can't trigger a nil value" yes, I found it out 2 secondes before you posted. thx any way Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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