I have two scripts and some remotes already put into ReplicatedStorage. I need to fire those events when a player clicks on dialog. I have a local script in Playergui (StarterGui) to detect when the events are fired and enable a specific shop based on the event fire. The problem is it does not not work, but there are no errors. Can someone please tell me what I'm doing wrong. Also, one more thing to mention is the fact that when I put print int here, it doesn't print, and also, the NPC no longer replies when an option is clicked.

Local script under dialog

local dia = script.Parent
local tog = game.ReplicatedStorage.Events.Shop

dia.DialogChoiceSelected:Connect(function(player, dialog)
	tog:FireClient(dialog.Name)
end)

The LocalScript under the PlayerGui

local tog = game.ReplicatedStorage:WaitForChild('Events'):WaitForChild('Shop')
local shop

tog.OnClientEvent:Connect(function(dialog)
	shop = script.Parent:WaitForChild(dialog)
	shop.Enabled = true
end)

One more thing. I VERY MUCH prefer to not use "StackEdit" Could Administrators possibly give us a little checkbox saying "Would you like to enable StackEdit" That would be very much appreciated

13 comments

0

you don't need different remote events for each shop. You can just send the client 'dialog.Name' and have the local script match it with a shop

0

ok

0

Do I need to do something for it to be sent over, how do I utilize what it sends...

0

When you use :FireClient() make sure to set its player parameter, ex. :FireClient(player), you can also give the remote values with other parameters, such as :FireClient(player, 101) where 101 would be the first item in the OnClientEvent function parameters

0

Ok I think i get it

0

Someone correct me if i'm wrong but basically, when i do "FireClient" I could put "tog0:FireClient(player, dialog.Name)" and then when recieving it I could put "tog0.OnClinetEvent:Connect(function(player, dialog)" and dialog would be the name of the dialog they chose

0

correct, but only the 'dialog' will be passed to the client not the player:"tog0.OnClientEvent:Connect(function(dialog)"

0

ok thx

0

Ok I did that, now I just need to solve my problem

0

is there any errors? infinite yield?

0

is 'shop' a frame?

0

It says no errors in the des.

0

I can't answer any more questions, got sleep and school, won't be home till 2:50 p.m Central Time