Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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)
0
Is there a team spawn? Raccoonyz 1092 — 4y
0
Yes. I unmarked neutral and changed the team color to match but it still doesnt work BxsicJeff 2 — 4y
0
Instead of destroying the head (killing them) you should teleport them instead. Raccoonyz 1092 — 4y
0
How can I do that? BxsicJeff 2 — 4y
View all comments (4 more)
0
Also if they die again would they be teleported back? BxsicJeff 2 — 4y
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. killerbrenden 1537 — 4y
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. killerbrenden 1537 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
Ive already manually edited teamcolor and disabled neutral BxsicJeff 2 — 4y
Ad

Answer this question