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

Script only working on one players screen?

Asked by 8 years ago

So, I have this simple intermission. It waits for 2 players to join, then goes through.

When I go into a server with 2 people, 1 person gets the timer, countdown, etc working, the other gets the Waiting for 2 players to join message. But they both end up being teleported.

Why isnt the timer working on the other players screens?

local tvalue = script.Parent.StatusTag
local gui = game.StarterGui.ChooseTeam.Main

function beginGame()
    for i = 20, 0, -1 do 
        wait(1)
        tvalue.Text = "Intermission: " .. i .. "" 
        if i == 0 then
            gui.Visible = true
            wait(8)
            gui.Visible = false
            wait(1)
            tvalue.Text = "Players are being teleported" 
            wait(0.5)
            tvalue.Text = "Game has Started!" 

            target = CFrame.new(171.8, 7.7, -157.2)
for i, player in ipairs(game.Players:GetChildren()) do 
   if player.Character and player.Character:FindFirstChild("Torso") then 
      player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0) 
   end
end
        end 
    end
end

if game.Players.NumPlayers > 1 then 
    beginGame()
else
    tvalue.Text = "Need 2 players for game to start. Invite your friends!" 
end
0
ok UniversalDreams 205 — 8y

1 answer

Log in to vote
1
Answered by
Azmidium 388 Moderation Voter
8 years ago

Don't update the StarterGUI. Loop through all the players and change it in the PlayerGui! :)

0
P.S: I will not spoon-feed you code Azmidium 388 — 8y
Ad

Answer this question