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

How do I give myself money for testing my small project? [ANSWERED]

Asked by
Zvtu 4
5 years ago
Edited 5 years ago

I'm not the most experienced scripter by any means. I was only trying to test a money system for my small game that I was going to make. It wouldn't work though. This is what I did:

-- My Personal Money
game.Players.PlayerAdded:Connect(function()
    Player.CharacterAdded:Connect(function()
        if Player.Name == "Zvtu" then
            game.Players.Zvtu.Cash.leaderstats.Value = 99999999
        end
    end)
end)

Any suggestions? ????

1 answer

Log in to vote
0
Answered by
3wdo 198
5 years ago
Edited 5 years ago

i found your problem you put Zvtu.cash.leaderstats and you forgot to put player in game.Players.PlayerAdded:Connect(function)

so your script would be:

game.Players.PlayerAdded:Connect(function(player) -- knows a player joined
    player.CharacterAdded:Connect(function()
        if player.Name == "Zvtu" then -- this checks the player is in the game
            game.Players.Zvtu.leaderstats.Cash.Value = 99999999 -- the thing you got wrong was you put cash.leaderstats
        end
    end)
end)

Hope this helps :)

0
Thanks mate. I should have noticed my mistakes. Have a good day! Zvtu 4 — 5y
Ad

Answer this question