Where? Also that didn’t work… Bruh
Sorry about that. You might not need a wait. Idk, if there is something in the output that says exhaustion or something then you will need a wait at the start or end of the loop
No error but warnings about different stuff
Maybe changing the rep name for replicated storage might help, change it to RS or Replicatedstorage or something
Sorry I took long to respond my phone ran out of battery and I had to go to bed
What’s the difference though? I don’t see any difference!
Nvm (Just checked it, does nothing) Also add prints to debug the script
TimerEnabled:GetPropertyChangedSignal("Value"):Connect(function()
if TimerEnabled.Value == true then
for i = timer,0,-1 do
print(i)
wait(1)
end
Are you sure it’s not supposed to be:
TimerEnabled:GetPropertyChangedSignal("Value"):Connect(function()
if TimerEnabled.Value == true then
for i = timer,-1 do
print(i)
wait(1)
end
Pretty sure that the winner value is an ObjectValue. (Line 30)
Delete this
local map = chosenmap.Value
and clone your choosen map
That’d also break the code… lol
Hm lemme see! Ima check rn eeeeee
Nope, it doesn’t work… This is getting ridiculous.
This is just Winner.Value.Value.
change the map to Winner.Value or to choosen map
Hey I think that i fixed ur buggy mess
I pretty much changed the script but you can edit it to ur likings.
Code
local timer = 30 --in seconds 121
local timerspeed = 1 --timer speed
local players = game:GetService("Players"):GetPlayers()
local rep = game:GetService("ReplicatedStorage")
local mapsfolder = game:GetService("Lighting"):WaitForChild("Maps")
local booleans = rep:WaitForChild("Booleans")
local variables = rep:WaitForChild("Variables")
local choice1 = variables:FindFirstChild("Choice1")
local choice2 = variables:FindFirstChild("Choice2")
local choice3 = variables:FindFirstChild("Choice3")
local winner = variables:FindFirstChild("Winner")
local Alive = workspace.Values.Alive
local TimerEnabled = workspace.Values.TimerEnabled
local mapsFolder = mapsfolder:GetChildren()
local chosenmap = winner.Value
local maps = {}
local solo = false
local map
local function start ()
for i,v in pairs(workspace.CurrentMap:GetChildren()) do
if v.ClassName == "Model" then
v:Destroy()
end
end
workspace.Values.Alive.Value = 0
TimerEnabled.Value = false
print("Starting...")
choice1.Value = maps[math.random(1,#mapsFolder)]
table.remove(maps,table.find(maps,choice1.Value))
choice2.Value = maps[math.random(1,#mapsFolder)]
table.remove(maps,table.find(maps,choice2.Value))
choice3.Value = maps[math.random(1,#mapsFolder)]
table.remove(maps,table.find(maps,choice3.Value))
wait(1)
booleans:FindFirstChild("VotingSession").Value = true
wait(10)
booleans:FindFirstChild("RevealVotes").Value = true
wait(5)
booleans:FindFirstChild("VotingSession").Value = false
booleans:FindFirstChild("RevealVotes").Value = false
if not winner.Value then
print("Something went wrong!")
end
local clonemap = chosenmap:Clone()
map = clonemap
print("Getting map...")
if clonemap.Spawn then
print("Success!")
else
print("Task failed successfully")
clonemap:Destroy()
end
clonemap.Parent = workspace.CurrentMap
for i, player in pairs(game:GetService("Players"):GetPlayers()) do
local char = player.Character
if char then
local humanoidrootpart = char:FindFirstChild("HumanoidRootPart")
print("TP")
char:MoveTo(map.Spawn.Position + Vector3.new(0,3,0))
--humanoidrootpart.Position = map.Spawn.Position + Vector3.new(0,3,0)
player.InGame.Value = true
Alive.Value += 1
TimerEnabled.Value = true
end
wait()
end
if Alive.Value < 2 then
if not solo then
print("Two or more players needed to start")
for i, player in pairs(game:GetService("Players"):GetPlayers()) do
local char = player.Character
if char then
print("Game Over")
char:MoveTo(workspace.Lobby.SpawnLocation.Position + Vector3.new(0,100,0))
workspace.Values.Alive.Value = 0
TimerEnabled.Value = false
end
wait()
end
start()
end
end
if timer ~= 30 then
timer = 35
end
print("Starting Game in 3")
wait(1)
print("Starting Game in 2")
wait(1)
print("Starting Game in 1")
wait(1)
end
start()
while true do
wait(timerspeed)
if timer > 0 then
timer -= 1
print(timer)
local Start = map:FindFirstChild("Start")
Start.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local playerz = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
local char = hit.Parent
local humanoid = char.Humanoid
if humanoid.Health > 0 then
humanoid.Health = 0
workspace.Values.Alive.Value -= 1
playerz.InGame.Value = false
end
end
end)
if Alive.Value == 1 then
if not solo then
for i, player in pairs(game:GetService("Players"):GetPlayers()) do
local char = player.Character
if char then
local humanoidrootpart = char:FindFirstChild("HumanoidRootPart")
print("Game Over")
char:MoveTo(workspace.Lobby.SpawnLocation.Position + Vector3.new(0,3,0))
--humanoidrootpart.Position = workspace.Lobby.SpawnLocation.Position + Vector3.new(0,3,0)
if player.InGame.Value == true then
player.InGame.Value = false
print("Winner is ".. player.Name)
else
print("Looser is ".. player.Name)
player.InGame.Value = false
end
workspace.Values.Alive.Value = 0
TimerEnabled.Value = false
end
wait()
end
wait(2)
for i,v in pairs(workspace.CurrentMap:GetChildren()) do
if v.ClassName == "Model" then
v:Destroy()
end
end
start()
end
end
else
for i, player in pairs(game:GetService("Players"):GetPlayers()) do
print("Time Is UP")
local char = player.Character
if char then
local humanoidrootpart = char:FindFirstChild("HumanoidRootPart")
char:MoveTo(workspace.Lobby.SpawnLocation.Position + Vector3.new(0,3,0))
--humanoidrootpart.Position = workspace.Lobby.SpawnLocation.Position + Vector3.new(0,3,0)
if player.InGame.Value == true then
player.InGame.Value = false
print(player.Name.. " Won")
else
player.InGame.Value = false
print(player.Name.. " Lost")
end
workspace.Values.Alive.Value = 0
TimerEnabled.Value = false
end
wait()
end
wait(2)
for i,v in pairs(workspace.CurrentMap:GetChildren()) do
if v.ClassName == "Model" then
v:Destroy()
end
end
start()
end
end
I also added some other features if you like. You can simply delete them if you dont them. Sorry that the script is long
Here is a video of how I think you want this system to work
Video Link
Yo man, I appreciate it. I’ma check if it works rn!
Oh wait right I gotta add some stuff into workspace… Lol!
uhhh… at the beginning of the code the local map has no meaning. Its just:
local map
This has a lot of trial and errors, you probably need a COPY for this game. Soooo… here u go lol:
BETA-Insanity-Tower-Escapes.rbxl (335.2 KB)
Hello. Sorry i took a while. The File is in your dms
This is the solution to my problem.
Nevermind lol i shouldve not assumed anyways here my continuation topic: