Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)


This discussion is preserved as it was. New answers, comments, and votes are closed.