local spawnloc = script.Parent.Name
script.Parent.CurrentOwner.Changed:Connect(function()
if script.Parent.CurrentOwner.Value == BrickColor.new("Bright blue") then
game.StarterGui.SpawnGui.Frame.Flag1.BackgroundColor3 = Color3.new(85/255, 170/255, 255/255)
for i,v in pairs(game.Players:GetChildren()) do
v.PlayerGui:FindFirstChild("SpawnGui").Frame:FindFirstChild(spawnloc).BackgroundColor3 = Color3.new(85/255, 170/255, 255/255)
end
elseif script.Parent.CurrentOwner.Value == BrickColor.new("Bright red") then
game.StarterGui.SpawnGui.Frame.Flag1.BackgroundColor3 = Color3.new(255/255, 80/255, 80/255)
for i,v in pairs(game.Players:GetChildren()) do
v.PlayerGui:FindFirstChild("SpawnGui").Frame:FindFirstChild(spawnloc).BackgroundColor3 = Color3.new(255/255, 80/255, 80/255)
end
elseif script.Parent.CurrentOwner.Value == BrickColor.new("Fossil") then
game.StarterGui.SpawnGui.Frame.Flag1.BackgroundColor3 = Color3.new(207/255, 207/255, 207/255)
for i,v in pairs(game.Players:GetChildren()) do
v.PlayerGui:FindFirstChild("SpawnGui").Frame:FindFirstChild(spawnloc).BackgroundColor3 = Color3.new(207/255, 207/255, 207/255)
end
end
end)
This script doesn't work in a server script, it doesn't change the player's GUI for some reason, so how would I turn this into a remote event script to work?

4 comments
What are you trying to do?
I'm trying to change the Player's GUI depending on what script.Parent.CurrentOwner.Value is equal to. If it's == Bright blue then change Player's GUI to a Blue colour, if Red then Red etc.
What is script.Parent?
script.Parent is a model