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

How to Change My Spawn Location and Teams? (fixed, thank you!)

Asked by 3 years ago
Edited 3 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

I need help with this change! Basically, I'm making an obby, but whenever the player goes over the first checkpoint, it either puts the player in a "Neutral" team or just doesn't put the player under the category.

Right now, my teams and checkpoints are named 0-2 (0, 1, 2)

I saw someone in another forum use this code:

part = workspace.partname
part.Touched:connect(function(h)
    if game.Players:GetPlayerFromCharacter(h.Parent).Team == game.Teams.Teamname then
    else
        game.Players:GetPlayerFromCharacter(h.Parent).Team = game.Teams.Teamname
        game.Players:GetPlayerFromCharacter(h.Parent).Humanoid:TakeDamage(math.huge)
    end
end)

But I'm not sure if it works, and if it does, I have no idea how to work it around my team names. I have no idea how to read or write code in general lol

Any help would be appreciated!! Including code and adjusting my teams/checkpoints(spawn locations) buttons in the properties menu

0
Did you try it ? It looks fine. Just change the Teamname to your team name. JesseSong 3916 — 3y
0
i dunno how to "encode lua code in the lua block code tag" :,] sorry man Hiitsmelololol12 0 — 3y

Answer this question