Hey Guys! So i wrote this and it runs perfectly, then suddenly on occasion it will run once and break giving saving it cant perform a moveto on nil..? Then on other occasions it will give that without even running once first. I make no altercations when it does this. its simply for whatever reason non-reliable. Can someone tell me why? or give me an alternative? I had used CFrame before but it was also shaky so I started using MoveTo.
ting = 0 function ontouch(Hit) if ting == 0 then ting = 1 local char = game.Workspace:FindFirstChild(Hit.Parent.Name) char:MoveTo(game.Workspace.PortalHub.Spawn.Position) wait(0.5) ting = 0 end end script.Parent.Touched:Connect(ontouch)
I changed the game to allow only R15 characters and started CFrame moving the HumanoidRootPart. For anyone who finds similar issues, this so far has not failed me!