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

How do i make two of the same team spawns but only spawn at one of the two spawns?

Asked by 10 years ago

I have two spawns. When someone joins the game there on the "Loading game" team. When they fall off of the spawner for the "Loading Game" there will be the "Visitor" spawn underneath it. But if someone dies in the Visitor spawn I do not want them near the Loading game spawn I want them on the grass. How can I make two of the same spawns but only spawn at one of the two spawns?

2 answers

Log in to vote
1
Answered by 10 years ago

Well, instead of using two spawns, just use one. Underneath the loading spawn, instead of a SpawnLocation, put in a script that changes the player's team when they touch it.

Things that will be relevant to you include Part.Touched, Players:GetPlayerFromCharacter, and Player.TeamColor.

0
Read below PADevelopSC 0 — 10y
0
Thank you it worked! PADevelopSC 0 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

So somehting like this? @iconmaster

tm = script.Parent

function onTouched(hit)
    local h = hit.Parent:FindFirstChild("Humanoid")
    if h ~= nil then
        local n = hit.Parent
        local p = game.Players:FindFirstChild(""..n.Name.."")
        if p ~= nil then
            p.TeamColor = tm.BrickColor
        end
    end
end

script.Parent.Touched:connect(onTouched)
0
Look into GetPlayerFromCharacter() instead of FindFIrstChild. Perci1 4988 — 10y

Answer this question