Hi,
I'd like to first introduce my problem. I've tried many variations & ways to create a functional FE team changing script & all of them fail to work.
Problems consisting of these - Server-Sides only (other players don't see it) - Player spawn doesn't work - Or Simply won't work
I've worked on remotes, etc.. I do on the other hand have a GUI system to use for the team changing, but it's pointless if it doesn't work. I have my game FE on.
Tutorials I've tried:
https://www.youtube.com/watch?v=C6LKaa10Zog&t=22s https://www.youtube.com/watch?v=deYNxV9-vpI&t=320s
etc...
My goal is to create a gamepass team, and once the user who clicks the button & doesn't have a gamepass it prompts purchase.. I think I got that part covered from a different question on this site.
Best Progress.. [NON FE]
local team = script.Parent.Team local player = game.Players.LocalPlayer local Timer = script.Parent -- The Timer is completely unrelated/uneccessary to the function of the team changing fyi. -- The Value is in the Team (Object Value) to ID the team name script.Parent.MouseButton1Click:Connect(function() script.Parent.Timer.Visible = not script.Parent.Timer.Visible wait(3) player.Team = team.Value player.Character.Humanoid.Health = 0 end)
Problems w/ this script.. Other players don't see the change.. Spawns don't work for some reason..
Thank you! I will appreciate the help :)
You need to use a remote as you're currently changing the player's team through a localscript so it does not replicate to the server. What it would look like:
local team = script.Parent.Team local player = game.Players.LocalPlayer local Timer = script.Parent local changeTeam = game:GetService("ReplicatedStorage").changeTeam -- The Timer is completely unrelated/uneccessary to the function of the team changing fyi. -- The Value is in the Team (Object Value) to ID the team name script.Parent.MouseButton1Click:Connect(function() script.Parent.Timer.Visible = not script.Parent.Timer.Visible wait(3) changeTeam:FireServer() end)
ServerScript:
game:GetService("ReplicatedStorage").changeTeam.OnServerEvent:Connect(changeTeam) function changeTeam(player) player.Team = path.ToTeam end