New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by
Zvtu 2
5 months ago
Edited 5 months 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 5 months ago
Edited 5 months 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 2 — 5mo
Ad

Answer this question