I am trying to make a button that you can buy something but only if you have a certain amount of "Deaths"
here's my script:
if game.leaderstats.Deaths.Value == 1 then game.Workspace.Parent.StarterPlayer.CharacterWalkSpeed = 70 end
Can you help me?
leaderstats is not a valid member of game, if you have output open, you will see this error the fix for this is to check the player leaderstats if you even have one by doing this (im assuming you already got a player variable for the player trying to buy something)
if player.leaderstats.Deaths.Value == 1 then --also, doing .Parent on workspace brings you back to game and my guess from your script is, you want to give the player 70 walkspeed, you do it like this player.Character.Humanoid.WalkSpeed = 70 end