I have this normal script under the the Dialog along with choices. The choices and dialog work fine but the problem is that the function does not work. The output doesn't print anything. Can someone tell me why. Also there are no errors in output.
Script under Dialog
local dia = script.Parent
local tog = game.ReplicatedStorage.Events.Shop
dia.DialogChoiceSelected:Connect(function(player, dialog)
print('Dialog option '..dialog..' was chosen')
tog:FireClient(dialog.Name)
end)
Local Script under Player Gui - Recieves the remote
local tog = game.ReplicatedStorage:WaitForChild('Events'):WaitForChild('Shop')
local shop
tog.OnClientEvent:Connect(function(dialog)
print('Remote Fired')
shop = script.Parent:WaitForChild(dialog)
shop.Enabled = true
end)
Also can someone please!!!!! add an option to disable StackEdit It is very inconvenient when inputing long scripts

3 comments
Try using this in a Local Script only
local script does not work with "DialogChoiceSelected"
It does, I literally have a game to do this in a LocalScript, you just cant use :FireClient() on the LocalScript, but you have to define "dia" directly by location