I just want to know how to make a dialog choice that when a player selects it, they buy an item that goes into their inventory.
1 Like
put a local script in player scripts (i just copied this from one of my old games)
local dialog = workspace.TableIcecream["Icecream guy"].Head.Dialog --basically the path to the Dialog
local RE = game,ReplicatedStorage.Food:WaitForChild('Food') --buy event
dialog.DialogChoiceSelected:Connect(function(plr, choice)
if choice.Name == 'Icecream' then
RE:FireServer(choice.Name, 3)
print('Icecream')
elseif choice.Name == 'Donut' then
RE:FireServer(choice.Name, 3)
print('Donut')
elseif choice.Name == 'Sundae' then
RE:FireServer(choice.Name, 3)
print('Sundae')
end
end)
3 Likes