This script for somehow makes no errors in Studio, but makes lots in real play. How come this doesn't work in real play?
while true do
local minigames = game.Lighting.Minigames:GetChildren()
local number = math.random(1, #minigames)
local map = minigames[number]
local spawns = map.Spawns:GetChildren()
for intermission = 25,1,-1 do
game.Workspace.Timer.Value = "Intermission: "..intermission
wait(1)
end
game.Workspace.Timer.Value = "The game will start shortly."
wait(3)
game.Workspace.Timer.Value = "Choosing Minigame..."
wait(3)
game.Workspace.Timer.Value = "Minigame: "..map.Name
wait(3)
game.Workspace.Timer.Value = "Loading Minigame..."
wait(3)
local mapModel = map:clone()
mapModel.Parent = workspace
game.Workspace.Timer.Value = "Teleporting players..."
wait(1)
for _, player in pairs(game.Players:GetPlayers()) do
player.InGame.Value = true
local character = player.Character
local randomSpawn = spawns[math.random(#spawns)] -- EDIT
if character then
character:MoveTo(randomSpawn.Position) -- EDIT
end
end
wait(1)
for readySetGo = 3,1,-1 do
game.Workspace.Timer.Value = readySetGo
wait(1)
end
for timer = 90,1,-1 do
for _, player in pairs(game.Players:GetPlayers()) do
local character = player.Character
if character then
character.Humanoid.Died:connect(function()
local inGame = player.InGame
inGame.Value = false
end) -- EDIT
end
end
game.Workspace.Timer.Value = "Time left: "..timer -- Not done yet? Then keep counting, i guess.
wait(1) --Wait before the next second counting
end
game.Workspace.Timer.Value = "Game over! Winners get 15 points!"
mapModel:remove()
for _, player in pairs(game.Players:GetPlayers()) do
inGame = player.InGame
if inGame then
if inGame.Value == true then
print("It works")
local points = player.leaderstats.Points
points.Value = points.Value + 15
player:LoadCharacter()
inGame.Value = false
end
end
wait(3)
end
end
BTW: I have FilteringEnabled on.

3 comments
Maybe turn that off. Instead, make a Kick() on whoever exploited your things.
Is this a LocalScript?
To mine: I have no idea how to do kick(). To rhyles: No. It is a server script