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

How do I fix my player specific leaderboard script?

Asked by 4 years ago
Edited 4 years ago

So I have a script that is for a specific person in your game, but it seems to not be working. Oh and I already have a script that auto adds money for people who are not specific. Does it mess up the specific Script? If you want to see the not specific Script that WORKS look below the broken script.

Broken Specific Script-

if player ("name") == "Nameofplayer" == true ---- In the "Nameofplayer" put your name or anybody elses name
wait(0) ---- the wait time
cash.Value = cash.Value + 000000 --- Replace the Zeros with the amount of money wanted and change the value to your value
end
end)

Does the script break the specific script?

Script-

game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue", p)
stats.Name = "leaderstats"
local cash = Instance.new("IntValue", stats)
cash.Name = "Cash" ---- Name of your cash
cash.Value = 0 ---- How much the player starts with
while true do
wait(30) ---- The wait time for adding the cash
cash.Value = cash.Value + 50 ---- The amount added after the wait time
end
end)

I would really appreciate the help, and can you check if it works because a lot of the time scripts don't work. Anyways have a nice day!

0
It will only break if specific one is run before normal one dinozaver_triceratop 78 — 4y

1 answer

Log in to vote
0
Answered by
iuclds 720 Moderation Voter
4 years ago
wait(1)
if player ("IUClDS") == "IUClDS" == true ---- In the "Nameofplayer" put your name or anybody elses name
wait() ---- the wait time
cash.Value = cash.Value + 000000 --- Replace the Zeros with the amount of money wanted and change the value to your value
end
end)

and

wait(.2)
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue", p)
stats.Name = "leaderstats"
local cash = Instance.new("IntValue", stats)
cash.Name = "Cash" ---- Name of your cash
cash.Value = 0 ---- How much the player starts with
while true do
wait(30) ---- The wait time for adding the cash
cash.Value = cash.Value + 50 ---- The amount added after the wait time
end
end)

the first script was running before the second

Ad

Answer this question