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

how do i trigger an npc to do an animation whe a player touches a brick?

Asked by 4 years ago

I have no idea how to do this. I've tried true/false values to trigger the animation and other stuff that was recommended, but none of it worked.. Please help!

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

well just do this:

local Players = game:GetService("Players")
local part = --the part to be touched
local AnimationID = 0000000-- the animation id

part.Touched:Connect(function(part)
    local humanoid = part.Parent:FindFirstChld("Humanoid");
    if(humanoid and not Players:GetPlayerFromCharacter(part.Parent)) then
        local animationTrack = humanoid:LoadAnimation(AnimationID);
        animationTrack:Play();
    end
end)
0
but that's playing animation on the player that touched the brick he wants the NPC to play animation not the player that touched. VitroxVox 884 — 4y
0
ohh lemme edit it a bit to accomondate for that User#23252 26 — 4y
0
Ok I’m about to test it peytonallen920 66 — 4y
Ad

Answer this question