MoveTo Script:
local NPC = script.Parent local part1 = game.Workspace.Part1 while true do NPC.Humanoid:MoveTo(part1.Position) wait(0.5) end
Touching Teleport & Killing:
local dum = game.Workspace.Dummy game.Workspace.Dummy.Hitbox.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then script.Parent.Parent:SetPrimaryPartCFrame(CFrame.new(0,0,0)) hit.Parent.Humanoid.Health = 0 end end)
Basic Animation:
local animation = script:WaitForChild('Animation') local humanoid = script.Parent:WaitForChild('Humanoid') local dance = humanoid:LoadAnimation(animation) dance:Play() while wait(0.5) do dance:Play() end
These are all of my codes, they work well they have no problem until i changed to a LocalScript. Should i do other stuff to convert to LocalScript or anything ? What should i do or what tutorials i need to watch ?
Local Scripts only work inside - Player's Character Scripts - Player's GUI - Player's Scripts
I think i solved my problem, thanks for realchricrocgamer to solving my problem here how i solved:
I put dummy in ReplicatedStorage, i put my scripts in StarterGUI, i cloned like that:
game.ReplicatedStorage.Dummy:Clone().Parent = game.Workspace
And thats it i solved like that. Thank you again realchricrocgamer.