Hello reader,
I am trying to make the script so that once the round is over if the player survived then it will add 100 to there leaderstats (the leaderstats is called “Money”) I tried and tried but it just broke my script so I came here for help I hope someone can help and here is my script:
local lobbyLocation = game.Workspace.Lobby.Position + Vector3.new(0,3,0)
local gameLocation = game.Workspace.Main.Position + Vector3.new(0,3,0)
local ReplicatedStorage = game:GetService(‘ReplicatedStorage’)
local timeEvent = ReplicatedStorage:WaitForChild(‘TimeEvent’)
local function playGame()
local player = game:GetService(‘Players’).LocalPlayer
local timeAmount = 160
local timerText = "Remaining Time: "while timeAmount > 0 do
timeEvent:FireAllClients(timeAmount, timerText)wait(1) timeAmount -= 1
end
endlocal function playIntermission()
local intermission = 30
local timerText = 'Intermission: ’
while intermission > 0 do
timeEvent:FireAllClients(intermission, timerText) wait(1) intermission -= 1
end
end
local function resetPlayers()
for _, plr in pairs(game.Players:GetChildren()) do
plr.Character.HumanoidRootPart.CFrame = CFrame.new(lobbyLocation)
end
end
local function teleportPlayers()
for _, plr in pairs(game.Players:GetChildren()) do
plr.Character.HumanoidRootPart.CFrame = CFrame.new(gameLocation)
end
end
while true do
resetPlayers()
playIntermission()
teleportPlayers()
playGame()
end
So thats my script any help is appreciated thanks.