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

how do i give certain teams different walk speeds and other features? [closed]

Asked by
iiNogz -10
4 years ago

Does anyone know how or have a script on how to change the walk speed for a certain team? i’m also looking for a way to change the walking animation of that team. i’ve tried looking everywhere but i can’t find any answers.

Closed as Not Constructive by hiimgoodpack

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 4 years ago

Whatever script you use for them to change teams, add the lines to change their walkspeed. It’s kinda hard to tell you exactly what you do if you haven’t posted any scripts you use. Do you use a script for them to change teams?

Ad
Log in to vote
0
Answered by 4 years ago

Here's a script I wrote that should do what you want. I'll break down each step of it and what it does.

--Configuration for the teams, change the stuff in quotation marks to your team names
local Teams = {
    ["Red Team"] = {
        WalkSpeed = 20
    },
    ["Blue Team"] = {
        WalkSpeed = 24
    }
}

--A player joined the game
game:GetService("Players").PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        --The player's character loaded, let's check what team they're on
        local Humanoid = character:WaitForChild("Humanoid") --Wait for the character's humanoid to load
        if not Teams[player.Team.Name] then
            --The player was on an unknown team, let's write a warning in the console
            warn(player.Name .. " was on a team that was not set up! (" .. player.Team.Name ..")")
        end
        Humanoid.WalkSpeed = Teams[player.Team.Name].WalkSpeed --Update the player's WalkSpeed
    end)
end)