So, when a player is on the "Host" team or becomes a host, I want the player to have a GUI pop up as soon as that happens.
while wait() do local plr = game.Players:GetPlayerFromCharacter() if plr.TeamColor == BrickColor.new("Really red") then local gui = game.ReplicatedStorage.HostUI gui.Parent = game.Players.LocalPlayer.PlayerGui wait(1) gui.HostFrame.Visible = true local k = game.ReplicatedStorage.kill:Clone() wait() k.Parent = plr.Backpack end end
Any problems with this script?
Hello, OldBo5!
Try this script:
game.Players.PlayerAdded:Connect(function() for i,plr in pairs(game.Players:GetChildren()) do if plr.TeamColor == BrickColor.new("Really red") then print(plr.Name .. " is on Really Red Team!") local gui = game.ReplicatedStorage.HostUI gui.HostFrame.Visible = true game.ReplicatedStorage.kill:Clone().Parent = plr.Backpack end end end)
ATTENTION: This script will work until player leaves the team!
Good Luck with your games!
local plr = game:GetService("Players").LocalPlayer --Define my player repeat plr:GetPropertyChangedSignal("Team"):wait() until plr.Team.Name == "Host" --Everytime the Team property changes, check if it's host, if it is then stop waiting local gui = game.ReplicatedStorage.HostUI:Clone() --Make a clone of the gui gui.Parent = plr.PlayerGui -- Put the gui inside of the PlayerGui wait(1) gui.HostFrame.Visible = true local k = game.ReplicatedStorage.kill:Clone() wait() k.Parent = plr.Backpack