I still haven't found an answer to this. I can't find info on how to "call" or "get" or whatever it is. I want the NPC's to target players in my game, as they are the enemy. This code works for parts in the workspace but I can't figure out how to get him to target my player.
while true do wait(2) local character = game.Workspace.Player local player = game.Players:GetPlayerFromCharacter(character) FindPath(player.UpperTorso.Position, 1, 1, 500) end
-- If I replace workspace.globe.Position with a part in workspace, it works fine.
This gives me the error: "Player is not a member of Workspace"
Im sorry to post again, but I totally didn't know how this website worked... If anyone has any help I am thankful. Im sorry again.
I'd like you to really quickly realize that typing game.Workspace.Player doesn't actually get the character. You have to get the player's character another way. Since this is a server-script you can't do LocalPlayer so you'll need to find an alternate way of finding the player. One way is using a RemoteEvent and then handling it in that script.
local character = game.Workspace.Player -- That doesn't work, there's nothing named 'Player' in the workspace.
Hope I helped, let me know :)