Impact: High
Frequency: Constantly
Reproduction Steps:
GetPropertyChangedSignal Team.rbxl (26.1 KB)
Press play then press the TextButton and see the output
Source Code
-- Script
game.Players.PlayerAdded:Connect(function(player: Player)
player:GetPropertyChangedSignal("Team"):Connect(function()
print("Server:", player.Team)
end)
player:LoadCharacter()
end)
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
player.Team = game.Teams.Red
wait() -- we need to insert wait for Team to replicate properly, try removing the wait() and see what happens
player.Team = nil -- will not work properly if Team is set to nil
wait()
player.Team = game.Teams.Blue
end)
-- LocalScript
local localPlayer = game.Players.LocalPlayer
localPlayer:GetPropertyChangedSignal("Team"):Connect(function()
print("Client:",localPlayer.Team)
end)
script.Parent.MouseButton1Down:Connect(function()
game.ReplicatedStorage:WaitForChild("RemoteEvent"):FireServer()
end)
Expected Behavior:
Expected behavior is for Player.Team to be changed to Red > nil > Blue
Actual Behavior:
Actual behavior is Player.Team changed to Red > nil > Red > Blue
Current workaround for this is to assign Player.Team to a placeholder Team instead of nil