Hello, I am new to scripting and i need help with this script. I don't know why this script is not working. I made PartB and i have monster in Workspace (inside monster is only Humanoid and parts of monster) But when i put this script to TriggerPart it's not working.
Any help is appreciated! :o
local Monster =Script.Parent.Parent.Monster local Animation =Monster.Humanoid:FindFirstChild('Animator')or instance.new('Animator',Monster.Humanoid) Animation:LoadAnimation(Script.Animation) Script.Parent.Touched:Connect(function() Monster.Humanoid:MoveTo(Script.Parent.Parent.PartB.Position) Animation:Play() end)
local Monster = Script.Parent.Parent:WaitForChild("Monster") local Animation = Monster.Humanoid:FindFirstChild('Animator') or instance.new('Animator', Monster.Humanoid) Animation:LoadAnimation(Script.Animation) Script.Parent.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then hum:MoveTo(Script.Parent.Parent.PartB.Position) Animation:Play() end end)
try this also make sure ur monster isn't anchored