Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Made a team changer that works except that it doesnt change your spawn. How do I fix?

I have made a team changer using a GUI. It uses image buttons and there are local scripts in each image button.

local Plr = game.Players.LocalPlayer 
local USMCID = 4487957 -- this is just so I can group lock the teams
function pressed()
    if Plr:IsInGroup(USMCID) then
    Plr.Team = game.Teams:FindFirstChild("US Marines")
    Plr.Character.Head:Destroy()
    script.Parent.Parent.Visible = false
        end
end

script.Parent.MouseButton1Click:Connect(pressed)

8 comments

0

Is there a team spawn?

0

Yes. I unmarked neutral and changed the team color to match but it still doesnt work

0

Instead of destroying the head (killing them) you should teleport them instead.

0

How can I do that?

0

Also if they die again would they be teleported back?

0

Try using RemoteEvents to teleport the player or event kill the player. If you don't, it won't be ServerSided and only the player playing will see it so it won't actually happen. If you need more information on how RemoteEvents work feel free to use one of my answers on a related post as a reference.

0

Or you can use a script instead of a local script. Which ever one you feel is the easiest. But, I recommend RemoteEvents as you have to do less complicated methods and work.

1 answer

well in that case it means SpawnLocation.TeamColor property is not set and/or the SpawnLocation.Neutral is true

set SpawnLocation.Neutral to false, and SpawnLocation.TeamColor to the corresponding team color

also make sure player.Neutral is false, and the player.TeamColor is set to the color SpawnLocation.TeamColor that the player will spawn to.

1 comment

0

Ive already manually edited teamcolor and disabled neutral

This discussion is preserved as it was. New answers, comments, and votes are closed.