i want a script that checks if the player’s name is the selected one and if true then make his money 100k but that does not work sadly
heres the script, its a server script in serverscript service
game.Players.PlayerAdded:Connect(function(plr)
wait()
if plr.UserId == "PlayerUserId" and plr.Name == "PlayerName" and plr.DisplayName == "PlayerDisplay" then
plr:WaitForChild("leaderstats").Bank.Value = 100000
end
end)
Got it to work, just change the playerUserId Variable and it will work, don’t use the name cause it’s a waste of time, just the UserId cause the UserId is always with the player and never changes
local players = game:GetService("Players")
local playerUserId = 123 -- Change
players.PlayerAdded:Connect(function(player)
if player.UserId == playerUserId then
player.leaderstats.Bank.Value = 100000
end
end)
well that worked thankfully thank you for your help i just added a wait, because theres a data store script that i have so i made a wait just to make the data store load and then change the bank money
heres the after changes for who is interested
local players = game:GetService("Players")
local playerUserId = 3045640856 -- My UserId
players.PlayerAdded:Connect(function(player)
wait(10) -- change it to anything you want i reccomend 4-10 seconds
if player.UserId == playerUserId then
player.leaderstats.Bank.Value = 100000
end
end)