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

Who can tell what is wrong and fix my script?It's about Round System.

Asked by
DashDQ 17
4 years ago

So first of all i wanted to try putting in my game the Round System.So i watched many videos on how to do this but it was one video i found that not even a single person got any errors.So i got some scripts from their and it didn t work.

If someone can tell me if it is me or Roblox because one time i had the same problem and i waited one day and then it's actually worked the script that i made.

If you want to know the video here it is: https://www.youtube.com/watch?v=ESzmiC_AzLw

Besides just for you to look if you find any mistakes

My script:local roundLenght = 5 local intermissionLenght = 10 local InRound = game.ReplicatedStorage.InRound local Status = game.ReplicatedStorage.Status

local LobbySpawn = game.Workspace.LobbySpawn local GameAreaSpawn = game.Workspace.GameAreaSpawn

InRound.Changed:Connect(function() 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 = intermissionLenght, 0, -1 do InRound.Value = false wait(1) Status.Value = "Intermission: ".. i .." seconds left!" end for i = roundLenght, 0, -1, do InRound.Value = true wait(1) Status.Value = "Game: ".. i .." seconds left!" end end end

spawn(roundTimer)

My LocalScript:

local Status = game.ReplicatedStorage.Status local TimerDisplay = script.Parent.TimerDisplay

Status.Changed:Connect(function() TimerDisplay.Text = Status.Value end)

If you find something wrong can you fix it for me and tell what was wrong there please?

0
Can you tell us what is the error? And please format your code next time. Block_manvn 395 — 4y
0
F o r m a t t h e s c r i p t Nguyenlegiahung 1091 — 4y
0
Accept my question Nguyenlegiahung 1091 — 4y
0
i mean answer Nguyenlegiahung 1091 — 4y
0
i mean answer Nguyenlegiahung 1091 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I pasted the script inside Roblox Studio and i saw a problem At line 12: (On the web not your script) You wrote:

 roundLenght, 0, -1, do 

Change that to:

roundLenght, 0, -1 do 

I will edit if i saw some more error

Hope this will help :D

0
OMG It actually work!!! DashDQ 17 — 4y
0
Accept my answer :D Nguyenlegiahung 1091 — 4y
Ad

Answer this question