Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Game not working with 2 players?

Ive made this game and it works perfectly with 1 player, but doesnt work with 2. it teleports 1 player into the map, after the 60 seconds is over it never comes back.

while true do
	
local ranNum = math.random(1,1)
wait(1)
local hint = Instance.new('Hint', Workspace)
hint.Text = "Intermission"
wait(10)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "3"
wait(1)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "2"
wait(1)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "1"
wait(1)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "Go!"
wait(1)
hint:Destroy()
if ranNum == 1 then
	game.ServerStorage.Map1:Clone().Parent = game.Workspace
	for i, v in pairs(game.Players:GetPlayers()) do
		v.Character.Torso.CFrame = CFrame.new(Vector3.new(-8, 34.9, 47))
		wait(60)
		game.Workspace.Map1:Destroy()
	end
end
game.Workspace.Map1:Destroy()
	
	
end

This works perfectly with 1 person, im not sure why it goes wrong. Its inside a normal script.

1 answer

✓ Accepted answer

You tried to wait(60) and :Destroy() the map for every player that is in the game. Try moving the wait(60) and :Destroy() to rite after the for loop.

while true do

local ranNum = math.random(1,1)
wait(1)
local hint = Instance.new('Hint', Workspace)
hint.Text = "Intermission"
wait(10)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "3"
wait(1)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "2"
wait(1)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "1"
wait(1)
hint:Destroy()
local hint = Instance.new('Hint', Workspace)
hint.Text = "Go!"
wait(1)
hint:Destroy()
if ranNum == 1 then
    game.ServerStorage.Map1:Clone().Parent = game.Workspace
    for i, v in pairs(game.Players:GetPlayers()) do
        v.Character.Torso.CFrame = CFrame.new(Vector3.new(-8, 34.9, 47))
    end
    wait(60)
    game.Workspace.Map1:Destroy()
end
game.Workspace.Map1:Destroy()


end

2 comments

0

on line 33?

0

It worked :), i dont know how but it did

This discussion is preserved as it was. New answers, comments, and votes are closed.