So you join the game... an npc walks up to you and a gui is supposed to pop up so the text label in it can type to make it look like the npc is talking to you... the only problem is i cant get the gui to activate when the npc is at the required destination. I use pathfinding service on the npc and it walks to an "end position" block i made. How will i go about activating a gui when the npc reaches the end point? would i use a local script? where would i put the script? I tried a remote event but it says its requiring a real characters touch of a block or something to active the remote event. The npc is obviously not a real player so the remote event doesn't activate.
✓ ANSWER ACCEPTED
How do I get my GUI to work when an NPC touches a block?
1 answer
✓ Accepted answer
https://developer.roblox.com/en-us/api-reference/function/Humanoid/Move https://developer.roblox.com/en-us/api-reference/event/Humanoid/MoveToFinished
You can use the Humanoid:Move() function to make the NPC walk towards a part, then use Humanoid.MoveToFinished to detect when they're done, then if it returns true then the gui shows up
This would be used as a script in workspace or serverscriptservice
local gui = -- your gui
local npc = -- your npc
local hum = npc:WaitForChild("Humanoid")
-- assuming you already have moved the humanoid towards the player
hum.MoveToFinished:Connect(function()
gui.Enabled = true
end)
Hope that helps and sorry if its complicated
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
It works! Thankyou
My other problem was that Roblox studio was acting up. The "player added" event was not working at all, so i think the problem is my computer :P