#pls help

1 messages · Page 1 of 1 (latest)

flat fiber
#

Code local function BuyNPC(Player, NPC, SpecificNPCFolder)
if Player.leaderstats.Cash.Value >= SpecificNPCFolder.Price.Value then
local AssignedPlatform = nil

ServerScriptService.CoreScript(Server):161: attempt to index nil with 'Price'

gentle mango
#

you need to check in on that

flat fiber
#

who can i check that

gentle mango
flat fiber
#

how can i make it

gentle mango
#

oh my god dude

#

is this even your code

#

dont copy paste things and expect it to work

flat fiber
#

ih had the code in a tutarial

round yoke
#

bro it's happening because the variable SpecificNPCFolder is nil when the function is called.

Since the script can't find the folder, it can't look inside it to find the Price value.

#

To prevent the script from crashing, you should verify that the folder exists before trying to check the price.