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

How to make a player and NPC play a animation when touching a brick?

Asked by 4 years ago
Edited 4 years ago
local player = game.Players.LocalPlayer 
local HEAD = player.Character.Head
local anim = player.Humanoid:LoadAnimation(HEAD.ShotByShotgun) 
local char = workspace.Them 
local humanoid = char.Humanoid 
local head = char.Head local G = humanoid:LoadAnimation(head.Die) 



function onTouched(hit) 
G:Play() 
anim:Play()
workspace.Touch.CFrame = CFrame.new(-27.385, -2.785, -5.89) 
wait(3)
workspace.SHOTGUN:Play()
end 

script.Parent.Touched:connect(onTouched)

1 answer

Log in to vote
0
Answered by 4 years ago

I think I have a solution to your problem First I would like to say that on line 4 your char variable says .them unless thats something in workspace also I would like to make sure that your animation name is the same as on the script~~~~~~~~~~~~~~~~~ function onTouched(hit) local player = game.Players.LocalPlayer local anim = player.Humanoid:LoadAnimation(player.ShotByShotgun) local char = workspace.Them local humanoid = char.Humanoid local head = char.Head local G = humanoid:LoadAnimation(head.Die) G:Play() anim:Play() workspace.Touch.CFrame = CFrame.new(-27.385, -2.785, -5.89) end script.Parent.Touched:connect(onTouched) ~~~~~~~~~~~~~~~~~

Ad

Answer this question