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

why will this script only work in studio and not the real game?

Asked by
zValerian 108
5 years ago

In studio it does as it is supposed to and it teleports the players where it is supposed to. However, in the real game it doesn't teleport them and it just stops there. Here is the script


print("Loaded Core") --Player Count Logic game.Players.PlayerAdded:connect(function() script.Players.Value = script.Players.Value - 1 end) game.Players.PlayerRemoving:connect(function() script.Players.Value = script.Players.Value + 1 end) script.Players.Changed:connect(function() local count = script.Players.Value game.ReplicatedStorage.Notify:FireAllClients(count) end) --Teleport Functions function tp() print(1) local a = game.Lighting.podss:Clone() a.Parent = game.Workspace local parts = {} print(11) for _,part in pairs(game.Workspace.podss:GetChildren()) do table.insert(parts,part) end for _,plr in pairs(game.Players:GetPlayers()) do local partchosen = parts[math.random(1,#parts)] print(111) plr.Character.HumanoidRootPart.CFrame = partchosen.CFrame for i,part in pairs(parts) do if part == partchosen then table.remove(parts,i) print("made it here lolz") a:Destroy() end end end end --round logic wait() print(script.Players.Value) while game.Workspace.PlayerCount.NumOfPlayers.Value > 1 do wait(45) s = Instance.new("Sound") s.SoundId = "http://www.roblox.com/asset/?id=1368260402" s.Volume = 1 s.Looped = false s.archivable = false s.Parent = game.Workspace s:Play() print("this") tp() wait() s = Instance.new("Sound") s.SoundId = "http://www.roblox.com/asset/?id=272730528" s.Volume = 1 s.Looped = false s.archivable = false s.Parent = workspace cd1 = workspace.cd.cd1 cd2 = workspace.cd.cd2 cd3 = workspace.cd.cd3 cd4 = workspace.cd.cd4 wait(5) s:Play() cd4.Transparency = 0 cd4.Transparency = 0 cd1.SurfaceGui.TextLabel.Text = 10 cd2.SurfaceGui.TextLabel.Text = 10 cd3.SurfaceGui.TextLabel.Text = 10 cd4.SurfaceGui.TextLabel.Text = 10 wait(1) cd1.SurfaceGui.TextLabel.Text = 9 cd2.SurfaceGui.TextLabel.Text = 9 cd3.SurfaceGui.TextLabel.Text = 9 cd4.SurfaceGui.TextLabel.Text = 9 wait(1) cd1.SurfaceGui.TextLabel.Text = 8 cd2.SurfaceGui.TextLabel.Text = 8 cd3.SurfaceGui.TextLabel.Text = 8 cd4.SurfaceGui.TextLabel.Text = 8 wait(1) cd1.SurfaceGui.TextLabel.Text = 7 cd2.SurfaceGui.TextLabel.Text = 7 cd3.SurfaceGui.TextLabel.Text = 7 cd4.SurfaceGui.TextLabel.Text = 7 wait(1) cd1.SurfaceGui.TextLabel.Text = 6 cd2.SurfaceGui.TextLabel.Text = 6 cd3.SurfaceGui.TextLabel.Text = 6 cd4.SurfaceGui.TextLabel.Text = 6 wait(1) cd1.SurfaceGui.TextLabel.Text = 5 cd2.SurfaceGui.TextLabel.Text = 5 cd3.SurfaceGui.TextLabel.Text = 5 cd4.SurfaceGui.TextLabel.Text = 5 wait(1) cd1.SurfaceGui.TextLabel.Text = 4 cd2.SurfaceGui.TextLabel.Text = 4 cd3.SurfaceGui.TextLabel.Text = 4 cd4.SurfaceGui.TextLabel.Text = 4 wait(1) cd1.SurfaceGui.TextLabel.Text = 3 cd2.SurfaceGui.TextLabel.Text = 3 cd3.SurfaceGui.TextLabel.Text = 3 cd4.SurfaceGui.TextLabel.Text = 3 wait(1) cd1.SurfaceGui.TextLabel.Text = 2 cd2.SurfaceGui.TextLabel.Text = 2 cd3.SurfaceGui.TextLabel.Text = 2 cd4.SurfaceGui.TextLabel.Text = 2 wait(1) cd1.SurfaceGui.TextLabel.Text = 1 cd2.SurfaceGui.TextLabel.Text = 1 cd3.SurfaceGui.TextLabel.Text = 1 cd4.SurfaceGui.TextLabel.Text = 1 wait(1) cd1.SurfaceGui.TextLabel.Text = ("") cd2.SurfaceGui.TextLabel.Text = "" cd3.SurfaceGui.TextLabel.Text = "" cd4.SurfaceGui.TextLabel.Text = "" cd4.Transparency = 1 end

leave all your questions below!

0
Is this the whole script? AltNature 169 — 5y
0
:connect is depricated use :Connect AltNature 169 — 5y

Answer this question