I cant get it to work
local PlrName = script.Parent.Parent.Parent.Owner.Value
print(PlrName)
local Plr = game.Players:FindFirstChild(PlrName)
print(Plr)
local CDP = Plr.leaderstats.CDP
local amount = 3
CDP.Value = CDP.Value + amount
I cant get it to work
local PlrName = script.Parent.Parent.Parent.Owner.Value
print(PlrName)
local Plr = game.Players:FindFirstChild(PlrName)
print(Plr)
local CDP = Plr.leaderstats.CDP
local amount = 3
CDP.Value = CDP.Value + amount
change line 5 to this (i guess):
local CDP = Plr:WaitForChild("leaderstats").CDP
before the player spawned, they need to insert the leaderstats inside.
So if you instantly check the leaderstats, they will get an error to you.
if this work please mark this as answer, if it wrong say the error below, Ill help too :P
This discussion is preserved as it was. New answers, comments, and votes are closed.
8 comments
Also this is the what it said
is Owner a stringvalue?
Yes 19:15:16.491 - Workspace.Zednov's Tycoon Kit.Tycoons.Factory.PurchasedObjects.DropperDirt.DropperScript:7: attempt to index local 'Plr' (a nil value)
The PlrName was DJH_100 for the value
are you providing the whole script? line 7 has nothing to do with local Plr
Yes Local CDP.Value is CDP = Plr.Leaderstats.CDP,
:?
Are the Owner and the Value was stringvalue?