emreb Posted June 25, 2014 Posted June 25, 2014 I am getting BadArgument @ setelementposition error on debug script. whats wrong with my script? I am really new on lua. function jumper () local playerpos = getLocalPlayer() local x, y, z = getElementPosition ( playerpos ) setElementPosition ( source, x, y, 100 ) end addCommandHandler ( "jump", jumper )
Et-win Posted June 25, 2014 Posted June 25, 2014 function jumper () local playerpos = getLocalPlayer() local x, y, z = getElementPosition ( playerpos ) setElementPosition ( getLocalPlayer(), x, y, 100 ) end addCommandHandler ( "jump", jumper ) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Cruze Posted June 25, 2014 Posted June 25, 2014 function jumper () local playerpos = getLocalPlayer() local x, y, z = getElementPosition ( playerpos ) setElementPosition ( getLocalPlayer(), x, y, 100 ) end addCommandHandler ( "jump", jumper ) huh, didn't you notice that he used local playerpos = getLocalPlayer()?, so instead of repeating getLocalPlayer(), using playerpos would fit.
Et-win Posted June 25, 2014 Posted June 25, 2014 huh, didn't you notice that he used local playerpos = getLocalPlayer()?, so instead of repeating getLocalPlayer(), using playerpos would fit. Yes I did. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Moderators IIYAMA Posted June 25, 2014 Moderators Posted June 25, 2014 Just simply use localPlayer inside your whole client code. It is a predefined variable and it is shorter so you have to write less characters. (and it is 1 ms faster then getLocalPlayer(), because it isn't a function.) . 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