Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I made a Cafe script which works in Studio but not in the actual game, any ideas?

So, uhh, I made a cafe where a NPC is supposed to give you your order (send it to your backpack). While it works in studio mode, it won't work in the actual game. The script is:

script.Parent.DialogChoiceSelected:Connect(function(player, choice)
	if choice.Name == "Latte" then game.ServerStorage.Latte:Clone().Parent = player.Backpack end
	if choice.Name == "Decaf" then game.ServerStorage.Decaf:Clone().Parent = player.Backpack end
	if choice.Name == "Espresso" then game.ServerStorage.Espresso:Clone().Parent = player.Backpack end
	if choice.Name == "Regular" then game.ServerStorage.Regular:Clone().Parent = player.Backpack end
	if choice.Name == "Cappuccino" then game.ServerStorage.Cappuccino:Clone().Parent = player.Backpack end
	if choice.Name == "Water" then game.ServerStorage.Water:Clone().Parent = player.Backpack end
end)

Every tool is in ServerStorage, the choices and the tools are correctly named and I have no backpack wiping script of any sorts in the game (yet) and the output log is empty excepting for an error from another script that has nothing to do with it.

The script is a child of the Dialog instance along with the dialog choices, and the Dialog itself is a child of the NPC's head.

What did I do wrong?

3 comments

0

Is it in a local script?

0

Is it Filtering Enabled or Disabled?

0

It's in a server script, and the game is FE since all new templates are so.

1 answer

Dialog.DialogChoiceSelected( Instance player, Instance dialogChoice ) does not work through Workspace.FilteringEnabled.

1 comment

0

is there anything i can use to make it work in FE or should i just ditch the idea?

This discussion is preserved as it was. New answers, comments, and votes are closed.