#my custom script named BT-gangin is returning an error when I try to use GetPlayer

1 messages · Page 1 of 1 (latest)

spice thistle
#

script name: bt-gangin (custom script)



^1SCRIPT ERROR: @bt-gangin/client/main.lua:873: attempt to call a nil value (field 'GetPlayer')^7```

I'm attempting to get the player object so that I can remove money from cash or bank based on how much the character has. 

I can use GetPlayerData but that doesnt return the functions for the player object so I can't really use that.
#

I have QBCore defined as local QBCore = exports['qb-core']:GetCoreObject() at the top of my script

paper plank
#

can you post the entire function please??? liine 8## to 890 or whatever

spice thistle
#

nah I figured it out.

#

the problem is that GetPlayer is a server function and I was trying to trigger it in a client script