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

Gui is only changing for one person?

Asked by 8 years ago
local x = game.Workspace.tpReceive.Position.X 
local y = game.Workspace.tpReceive.Position.Y
local z = game.Workspace.tpReceive.Position.Z


function onTouched(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent) 
        local gui = player.PlayerGui.WinnerStatusGui.WSFrame.WSText
        local gui2 = player.PlayerGui.PointsGui.PointsFrame.Points 
        local number = tonumber(gui2.Text) 
        gui.Text = hit.Parent.Name.." has prevailed!" 
        if number == nil then number = 0 
        end
        number = number+1 
        gui2.Text = number 
        for i, object in pairs(game.Workspace:GetChildren()) do 
            if object:FindFirstChild("Torso") then 
                local torso = object.Torso
                torso.CFrame = CFrame.new(x,y,z) 
            end
        end
        wait(6) -- wait 6 seconds
        gui.Text = "  " 
    end
end

script.Parent.Touched:connect(onTouched)

Was written yesterday with some help from this wonderful community! But, the last thing with this gui, is that it only changes for one player. I've tried multiple things, but I'm honestly clueless apparently. Thank you guys a million for all the help!!

0
It's because you are looking in the player who touches the part, there PlayerGui, not the whole games UI NinjoOnline 1146 — 8y

Answer this question