so I am making UI for when a player joins the game, You can choose two sides: Britain And Iceland. The UI works but when you change teams it only shows up on your device. it works in singelplayer but when i do a teamtest it breaks. No error in output or anything
SCRIPT:
local BritainButton = script.Parent.Britain
local IcelandButton = script.Parent.Iceland
local YouROT = script.Parent.YouAReOnTeam
local ClickSound = script.Parent.Click
local Teams = game:GetService("Teams")
--Teams
local Iceland = Teams.Iceland
local Britain = Teams.Britain
--Britain Button
BritainButton.Activated:Connect(function()
local Player = script.Parent.Parent.Parent
local PlayerNamee = Player.Name
if Player.Team == Britain then
YouROT.TextTransparency = 0
wait(1)
YouROT.TextTransparency = 1
else
ClickSound:Play()
game.Workspace:WaitForChild(PlayerNamee).HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-13579, 30.812, 545))
Player.TeamColor = Britain.TeamColor
--Player:LoadCharacter()
script.Parent.Enabled = false
end
end)
--Iceland Button
IcelandButton.Activated:Connect(function()
local Player = script.Parent.Parent.Parent
local PlayerNamee = Player.Name
if Player.Team == Iceland then
YouROT.TextTransparency = 0
wait(1)
YouROT.TextTransparency = 1
else
ClickSound:Play()
game.Workspace:WaitForChild(PlayerNamee).HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-13579, 30.812, 545))
Player.TeamColor = Iceland.TeamColor
--Player:LoadCharacter()
script.Parent.Enabled = false
end
end)
Here's an image of the explorer:
Here's an image of the UIi:
Video(Bad quality ) https://gph.is/g/E3pQBoO
Thanks in regard.
maggi124

2 comments
That's how it works. The user**-interface correlates to the local device.
Remote Events might be what you are looking for. But as @Ziffixture said, they will run on the client only.