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

how do you make an animation work when a certain player steps on a brick?

Asked by 6 years ago

how do you make an animation work when a certain player steps on a brick and when they do how will you make it so that there skin will change color. im curious its for a game im making

0
You need to use Touched:connect() event to run a function when a part was touched igric 29 — 6y

2 answers

Log in to vote
0
Answered by
igric 29
6 years ago
local part = script.Parent
local player = game.Players.LocalPlayer.Character
local animation = player.Humanoid:LoadAnimation(script.Animation)
local canRun = true

local function animationAndSkin()
    if canRun == true then
    animation:Play()
    player.Head.BrickColor = BrickColor.new("[Body Color Here]")
    player.LeftLeg.BrickColor = BrickColor.new("[Body Color Here]")
    player.RightLeg.BrickColor = BrickColor.new("[Body Color Here]")
    player.Torso.BrickColor = BrickColor.new("[Body Color Here]")
    player.LeftArm.BrickColor = BrickColor.new("[Body Color Here]")
    player.RightArm.BrickColor = BrickColor.new("[Body Color Here]")
    canRun = false
    wait(5)
    canRun = true
end

part.Touched:connect(animationAndSkin)

Ok, so, make sure that this is a LOCAL SCRIPT and put it in that part you want to touch. Next Put an animation INSIDE of the LOCAL SCRIPT. Last thing is change every [Body Color Here] to whatever color you like, but dont forget to put your color in "". Note: This script works only with the R6 character.

Ad
Log in to vote
0
Answered by
iRexBot 147
6 years ago

We are not a script request site but I can give you what you need to make one. The Roblox wiki is very helpful with this. (Assuming you know how to script if not learn how to script first) How to animate 101 Part touched That's all I can assist you. I will not script anything for you as we FIX SCRIPTS not make scripts.

Answer this question