Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

"leaderstats is not a valid member of playergui"?

Asked by 1 year ago
Edited 1 year ago

Anyone know how to solve my error? dunno if this changes the script or anything, but my leaderstats script is under serverscriptservice.

Script:

local button = script.Parent local gui=button.Parent local player=gui.Parent.Parent

button.MouseButton1Click:Connect(function() if player.leaderstats.racks.Value>=200 then player.leaderstats.racks.Value-=200

ClonedTalent = game.ServerStorage.Talents.Ben:Clone() ClonedTalent.Parent = game.Workspace ClonedTalent.Name = "Talent" end;end)

1 answer

Log in to vote
0
Answered by 1 year ago

Change local player = gui.Parent.Parent to local player = gui.Parent.Parent.Parent

Ad

Answer this question