Jump to content

Attempts To Call Global getLocalPlayer (a Nil Value)


Recommended Posts

Posted

Well The Title Says All i Get That Error, Attempts To Call Global getLocalPlayer (a Nil Value)

My Script!

function armor(thePlayer) 
    name = getPlayerName(getLocalPlayer(thePlayer)) 
    if name == "Harry_Shea" then 
    setPedArmor(thePlayer, 100) 
end 
end 
addCommandHandler("armor",armor) 

Guest Guest4401
Posted

You are using a serverside script and getLocalPlayer is clientside function. And you don't even require that in the first place.

Try

function armor(thePlayer) 
    name = getPlayerName(thePlayer) 
    if name == "Harry_Shea" then 
        setPedArmor(thePlayer, 100) 
    end 
end 
addCommandHandler("armor",armor) 

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...