#Script to move rig/npc to a location

1 messages · Page 1 of 1 (latest)

kind river
#
When time() = 10 then
    ???:moveto()
end
#

this is a script on a remote event i want this script to teleport the npc to a location orientation i could figure out after

elder dagger
kind river
#

yes

harsh cedarBOT
#

studio** You are now Level 3! **studio

kind river
#

how do i move the parent of the remote event

#

?

elder dagger
# kind river how do i move the parent of the remote event

the OnServerEvent of the RemoteEvent is a callback that always gives you the player

remoteEvent.OnServerEvent:Connect(function(player, <other params>)
  local char = player.Character
  local humanoid = char.Humanoid
  humanoid:MoveTo(<position>)
  -- Or you can teleport the whole model
  char:MoveTo(<position>)
end)
kind river
#

how would i do this but for any rig/npc

elder dagger
#

If the event is elsewhere

-- Client
remoteEvent:FireServer(npcModel)

-- Server
remoteEvent.OnServerEvent:Connect(function(playerWhoFired, npcModel)
  npcModel.Humanoid:MoveTo(<position>)
  -- To teleport
  npcModel:MoveTo(<position>)
end)

Does that make sense?

kind river
#

kinda

#

i'm definitely going to hire someone for this though

elder dagger