Im trying to fire a remote event when player selects the correct option in the dialog. But i have no idea how to do it, since i never worked with dialogs before.
Do you have any idea how can i do this?
Im trying to fire a remote event when player selects the correct option in the dialog. But i have no idea how to do it, since i never worked with dialogs before.
Do you have any idea how can i do this?
I have made a topic like this, you can read it here:
If you don’t want to read it, you can do this:
script.Parent.DialogChoiceSelected:Connect(function(plr,dialog)
local event = game.ReplicatedStorage.DialogEvent
event:FireClient(plr)
end)
When you say for example, “Hi.”, it will fire the remote event. If you want the remote event to fire when you start chatting with the player, like when you click the “?” above the NPC’s head, you do this:
script.Parent:GetPropertyChangedSignal("InUse"):Connect(function()
if script.Parent.InUse == true then
local event = game.ReplicatedStorage.DialogEvent
event:FireClient(plr)
end
end)
Wrote in the dev forum, not tested.
Find a way to get the player so you can fire the remote event.