#Shop Bug

1 messages · Page 1 of 1 (latest)

vapid osprey
#

local program = script.Parent
local sandwhich = game.ReplicatedStorage:WaitForChild("Sandwich")
local cake = game.ReplicatedStorage:WaitForChild("Cake")
local pizza = game.ReplicatedStorage:WaitForChild("Pizza")
local pizzaDia = program:WaitForChild("Dialog"):WaitForChild("DialogChoice"):WaitForChild("PIZZA")
local SandDia = program:WaitForChild("Dialog"):WaitForChild("DialogChoice"):WaitForChild("SANDWICH")
local CakeDia = program:WaitForChild("Dialog"):WaitForChild("DialogChoice"):WaitForChild("CAKE")
local dialog = script.Parent:WaitForChild("Dialog")

dialog.DialogChoiceSelected:Connect(function(player, choice)
if choice == pizzaDia then
if not player.Backpack:FindFirstChild("Pizza") then
pizzaDia.ResponseDialog = "HERE YA GO WITH EXTRA CHEESE"
local new = pizza:Clone()
new.Parent = player.Backpack
elseif player.Backpack:FindFirstChild("pizza") then
pizzaDia.ResponseDialog = "YA ALREADY GOT PIZZA! DONT BE GREEDY"
end
end
if choice == SandDia then
if not player.Backpack:FindFirstChild("Sandwich") then
SandDia.ResponseDialog = "HERES YA SANDWICH"
local new = sandwhich:Clone()
new.Parent = player.Backpack
elseif player.Backpack:FindFirstChild("Sandwich") then
SandDia.ResponseDialog = "YA GOT IT ALREADY!"
end
end
if choice == CakeDia then
if not player.Backpack:FindFirstChild("Cake") then
CakeDia.ResponseDialog = "HERES SOME YUMMY CAKE!"
local new = cake:Clone()
new.Parent = player.Backpack
elseif player.Backpack:FindFirstChild("Cake") then
CakeDia.ResponseDialog = "I AINT GIVING YA ANOTHER ONE PAL"
end
end
end)

#

(dont mind my waitforchilditis)

ocean hornet
#

Be more specific

#

Whats the bug?

#

What error does it give?

vapid osprey
#

doesnt really give any error in the output just doesnt work at all

ocean hornet
#

What doesnt work?

#

Be specific

vapid osprey
#

well, when i talk the part that has the dialog, instead of the response dialog changed it gives me the placeholder and no item

ocean hornet
#

Try adding some prints in locations and see if its runs it. Just try find where it stops the execution

vapid osprey
#

sure

frank sorrelBOT
#

studio** You are now Level 1! **studio

vapid osprey
#

im back, heres the code and there was nothing in the output 😭

ocean hornet
#

If u were checking the pizza, the error likely lies in the fact u dont have Pizza capitalized in the elseif

#

Wait did it not even run the dialofchoiceselected?

vapid osprey
#

no

#

let me look for any errors outside the script

#

i see the error! the DialogChoiceSelected event is client-side only and will not fire on the server. this is a server script.

ocean hornet
#

Well theres your issue then

vapid osprey
#

ill fix it, this will be tagged as solved