Npc
A character in your place that can walk, turn and speak, which you get from npc.find or npc.all.
Everything on the Instance channel works on it too.
A character in your place that can walk, turn and speak, which you get from npc.find or npc.all.
Everything on the Instance channel works on it too.
Copies a user's appearance onto the NPC, or gives the ID it copies when you pass nothing. 0 is the default appearance.
guide:user_id(12345)Use it fordressing a guide or shopkeeper as a real player, such as the game's creator.
user_idoptionalThe platform user ID to copy, 0 for the default appearance. Omit it to get the current ID.Makes the NPC walk to a position or an instance, at a speed you can choose.
local movement = guide:move_to(door, { speed = 8 })Use it forguides that lead players around, guards on patrol, or villagers wandering the town.
targetA position, or an instance to walk to.optionsoptionalThe walking speed.move_to callspeedspeedHow fast the NPC moves in studs per second, which must be above 0 and is the place's walk speed by default.
Moves the NPC to a position or an instance at once, without walking.
guide:teleport(math3d.vector3.new(0, 0, 10))Use it forputting a shopkeeper back in place, or moving an NPC between areas.
targetA position, or an instance to go to.Turns the NPC so it faces a position or an instance.
guide:face(player.position)Use it formaking a shopkeeper look at the player who is talking to them.
targetA position, or an instance to turn toward.Shows a speech bubble with your text above the NPC.
guide:say("Follow me!", { duration = 3 })Use it forgreetings, hints, or quest lines that NPCs say to players.
textWhat the NPC says, at most 1000 characters.optionsoptionalHow long the Speech Bubble shows.say calldurationdurationHow many seconds the Speech Bubble shows, which by default depends on how long the text is.