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 ?

14 comments
Some of your scripts aren't supposed to be LocalScripts, I can tell you that for sure. Can you provide any error messages or does your code not output any?
The Animation script is supposed to be a LocalScript but your MoveTo and Teleport/Killing should be server sided otherwise, your only affecting your client and not others.
You shouldn't use while true do also because, it's going to repeat it over and over again which may cause performance issues.
Its simple obby game but your chasing by npc, if npc catch you you will die and all your checkpoints are resets. So i want that npc client side, i mean if someone join later npc cant chase him right ? because npc far away from start (correct me if im wrong) so yeah how im gonno do that
Ah okay, yeah yeah. I get you. Do you want me to write you some scripts that will be client sided?
Well if its helpful it would be great
Alright, I'll fix some up rn
Mate im going to sleep, its 04,34 AM in my country. If you know any tutorial to solve my problem please post here. Good Night.
I'll leave them attached to the post then you can see them tomorrow but, I'll look for a tutorial for you too.
Hi dude i woke up for school, did you find anything ? btw Good Morning
Why do you change it in the first place? Localscript are usually use for camera manipulation, mouse manipulation, gui manipulation and etc
Because i want to make client side npc and i thought i should use local script for that am i wrong ?