So I have this code for a Round Timer, which teleports you to another Map after some seconds.
-- Round variables
local roundLength = 60
local intermissionLength = 15
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status
local LobbySpawn = game.Workspace.Lobby.LobbySpawn
local GameAreaSpawn = game.Workspace.Map1.GameAreaSpawn1
InRound.Changed:Connect(function()
wait(1)
if InRound.Value == true then
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
end
else
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
end
end
end)
local function roundTimer()
while wait() do
for i = intermissionLength, 1, -1 do
InRound.Value = false
wait(1)
Status.Value = "Intermission: ".. i .." seconds left!"
end
for i = roundLength, 1, -1 do
InRound.Value = true
wait(1)
Status.Value = "Game: ".. i .." seconds left!"
end
end
end
spawn (roundTimer)
This works fine. On my other Map I have a spinning object which should start spinning 5sec after the value of InRound = true. I have this code for it:
local InRound = game.ReplicatedStorage.InRound
if InRound.Value == true then
wait(5)
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(.0,.05,.0)
wait()
end
But it kinda doesnt spin. I hope you can help! Thanks
