I made a team change GUI following a you tube tutorial. The script isn't working for whatever reason and I can't find why. Can anyone help me please?
player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function() if player:IsInGroup(3632443) then player.TeamColor = BrickColor.new("Shamrock") player:LoadCharacter() end end)
Thanks, Gun.
After reading your problem, I would like to try to solve your problem. This script would change your team and respawn the player in a different way
-- Local Script local Player = game.Players.LocalPlayer local Teams = game:GetService("Teams") script.Parent.MouseButton1Click:connect(function() if Player:IsInGroup(3632443) then Player.Team = Teams:FindFirstChild("TEAM") -- Change TEAM for your team name. game.ReplicatedStorage.REMOTE_EVENT:FireServer() -- We need a Remote Event to be able to tell the server that we want to respawn.(Change REMOTE_EVENT for your remove event's name.) end end)
-- Script game.ReplicatedStorage.REMOVE_EVENT.OnServerEvent:connect(function(Player) -- (Change REMOTE_EVENT for your remove event's name. Player:LoadCharacter() -- We respawn the player from the server as LoadCharacter can only be called from the server. end)
References:
http://wiki.roblox.com/index.php?title=API:Class/Teams
http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent
Hope that helped.(Sorry for any mistakes, grammar mistakes or bad explanation.)