Drakath Posted January 10, 2014 Posted January 10, 2014 Does 'getPedTargetCollision' work with fists? I tried to use it for my zombies but it returned boolean.
Drakath Posted January 10, 2014 Author Posted January 10, 2014 It works with fists. But I keep getting a nil value when I'm not near an obstacle. function get() local sx,sy,sz = getPedTargetCollision(localPlayer) outputChatBox(sx..", "..sy) end addEventHandler("onClientPreRender",getRootElement(),get) How can I fix it?
xXMADEXx Posted January 10, 2014 Posted January 10, 2014 Use: if sx and sy and sz then ... code .... end The Ultimate Lua Tutorial! | MTA PHP SDK
DNL291 Posted January 10, 2014 Posted January 10, 2014 get already is a MTA function. https://wiki.multitheftauto.com/wiki/Get Please do not PM me with scripting related question nor support, use the forums instead.
Moderators IIYAMA Posted January 10, 2014 Moderators Posted January 10, 2014 get already is a MTA function.https://wiki.multitheftauto.com/wiki/Get True, but he will overwrite it. Just like a wrapper, won't cause any serious problems afk. But it should be prevented, the mta function will not be able to use in that script.(if it isn't redefined) 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
DNL291 Posted January 11, 2014 Posted January 11, 2014 True, but he will overwrite it. Just like a wrapper, won't cause any serious problems afk. But it should be prevented, the mta function will not be able to use in that script.(if it isn't redefined) Yes, i didn't said it would cause stack overflow, because it's not a clientside function. That isn't what is causing the error, anyway. But as you said - "it should be prevented". Please do not PM me with scripting related question nor support, use the forums instead.
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