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

Brick = team change?

Asked by 10 years ago

So I want a script that will make a player change team when they stand on a brick. I've asked so many people and tried tonnes of things, but none of them seem to work.

Help please?

1 answer

Log in to vote
0
Answered by 10 years ago

You might want to read this.

You can/should be able to use a team oriented spawn location to change a player's team as it is touched, but this can be done through script as well - using the Touched event.

local sp = script.Parent
sp.Touched:connect(function(hit)
    local player = 
    game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) 
    if hit.Parent:FindFirstChild("Humanoid") and player then

        player.TeamColor = BrickColor.new("Bright green")

    end
end)
Ad

Answer this question