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
✓ ANSWER ACCEPTED
how do you make an animation work when a certain player steps on a brick?
2 answers
✓ Accepted answer
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.
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You need to use Touched:connect() event to run a function when a part was touched