Jump to content

[HELP] getLocalPlayer returns nil value


Recommended Posts

Posted (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 by Galactix
  • Moderators
Posted (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 by IIYAMA
Posted

Now my getElementData just outputs Bad argument, expected element got nil when I write 

Quote

 local requestStatus = getElementData( localPlayer , "healrequest")

 

 

  • Moderators
Posted
39 minutes ago, IIYAMA said:

(If that one returns nil, than the script is being read as a server file)

 

 

So not clientside.

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...