I'm making intermission. It work fine in Roblox Studio but in game nothing of script work.
local text = script.Parent local map = game.Workspace.MAP function GameBegin() map.Script.Disabled = false for i = 3, 0, -1 do wait(1) text.Text = "Intermission: " ..i.. "" if i == 0 then script.Parent.Parent.Parent.Parent.Character:moveTo(map.Position) text.Text = "Game Started!" wait(1) for m = 3,0,-1 do wait(1) text.Text = "Time Left: " ..m.. "" if m == 0 then text.Text = "Time Up!" script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 wait(5) GameBegin() end end end end end if game.Players.NumPlayers > 0 then GameBegin() end
This is server script.
Here is link of my game https://www.roblox.com/games/2187266915/KimKeng-Sword-Battle
More: "This game may not function as intended. The developer needs to update the game." What is it??? it's above Play Button.
Players 'connect' to the game way before they actually load. This means that the server thinks a player has joined a game before said player is actually playing, and will start the countdown before a player can even see it.
This means that a players character will not even be in the game when the countdown finishes and the script breaks because it can't find the player's character.
A pretty dependable way to wait for players to load is to create a function GetNumberOfPlayers that return the number of players s.t. Player.Character ~= nil and Player.Character:findFirstChild("Humanoid") ~= nil