Script in part
local interval = 1
local ting = 0
function onTouched(hit)
local lol = hit.Parent:FindFirstChild("Touched")
lol.Value = 0
if lol.Value == 1 then
wait()
else
if ting == 0 then
ting = 1
local check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local CoolBeans = 1
while CoolBeans == 1 do
for i,v in pairs(game.Players:GetPlayers())do
v.leaderstats.Time.Value = v.leaderstats.Time.Value + 1
wait(interval)
if lol.Value == 0
then local Coolbeans = 0
end
end
end
end
end
end
ting = 0
end
script.Parent.Touched:connect(onTouched)
Leaderboard script
function PlayerEntered(newPlayer)
local stats = Instance.new("IntValue")
stats.Parent = newPlayer
stats.Name = "leaderstats" --the box that shows up on the screen below is what it will have in it
local Time = Instance.new("IntValue")
Time.Parent = stats
Time.Name = "Time" --what you want youre currency to be called ie (robux, tix ect.) if you edit this make sure you make two if these"" around the word or it wont work
Time.Value = 0 --how much money or in this case points you want youre map to start with
local Meme = Instance.new("IntValue")
Meme.Value = 0
Meme.Name = "Touched"
end
game.Players.ChildAdded:connect(PlayerEntered)
I'm not very good at scripting but I really want to get this to work but I just can't figure it out. The script is probably all messed up because I suck at scripting but if you have any question put them in the comments.
