When player change team don't change for other player view

Hi im a new scripter and im creating an fps game.
I have a problem:
When a player change team the other player see him in the neatral team and not in the team he choose, but in his screen he see him in the correct team.
Anyone can help me?

Image

image

Change team script
script.Parent.MouseButton1Click:Connect(function()
	tweenin:Play()
	tweenin.Completed:Connect(function(playbackstate)
		if playbackstate == Enum.PlaybackState.Completed then
			tweenout:Play()
			script.Parent.Parent.Parent.Parent.main_frame.Visible = false
			script.Parent.Parent.Parent.Parent.Parent.LevelGui.BarBG.Visible = false
			tweenservice:Create(game:GetService('Lighting').Blur,TweenInfo.new(1),{Size = 0}):Play()
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
			Camera.CameraSubject = Player.Character.Humanoid
			Camera.CameraType = Enum.CameraType.Custom
			Camera.CFrame = Player.Character.Head.CFrame
			game.ReplicatedStorage.ChangeTeamEvent:FireServer(script.Parent.Name)
			script.Parent.Parent.Parent.Parent.Parent.HardpointUI.Frame.Visible = true
			script.Parent.Parent.Parent.Parent.Parent.HardpointUI.Announcement.Visible = true
			

                        playerLocal.Team = teams.Away


			script.Parent.Parent.Parent.Parent.Parent.FPS_PING.Enabled = true
		end
	end)
end)

This is because you’re doing it on a client script. Which means the script only runs for the player and not everyone else.
Use a remote event and a server script to change the team.

1 Like

Thanks im in roblox studio now i’ll try it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.