Galactix Posted July 9, 2018 Posted July 9, 2018 (edited) Hello, I have the Following issue: I tried to set a variable to a getLocalPlayer but it just keeps returning nil value, why? My script is clientside so this is not the problem local player = getLocalPlayer ( ) Edited July 9, 2018 by Galactix If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
Moderators IIYAMA Posted July 9, 2018 Moderators Posted July 9, 2018 (edited) Maybe you have another function named getLocalPlayer? So many things can cause this. With the code you showed me is nothing wrong. How about you try to use the predefined variable localPlayer instead? (not a function) (If that one returns nil, than the script is being read as a server file) Edited July 9, 2018 by IIYAMA 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
Galactix Posted July 9, 2018 Author Posted July 9, 2018 Now my getElementData just outputs Bad argument, expected element got nil when I write Quote local requestStatus = getElementData( localPlayer , "healrequest") If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
Moderators IIYAMA Posted July 9, 2018 Moderators Posted July 9, 2018 39 minutes ago, IIYAMA said: (If that one returns nil, than the script is being read as a server file) So not clientside. 1 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
Galactix Posted July 9, 2018 Author Posted July 9, 2018 You were right; I actually got it working, thanks so much 1 If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
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