Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

"leaderstats is not a valid member of playergui"?

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.