So I figured out what happend with this error but I don't know how to fix it. What basically happends is that when you click on the dialog the thing above text says what happend before the text. In studio it doesn't work like that. How do I fix?
wait(.25)
local loc = script.Parent
local storage = game:WaitForChild('ReplicatedStorage'):WaitForChild('Resources'):WaitForChild('Tools'):WaitForChild('Purchases')
--- dialog ----
local ze = loc:WaitForChild('ze'):WaitForChild('hi')
local item = storage:WaitForChild('Rock') -- item location
local price = 50 -- price
local acceptdialog = 'yeet' -- dialog when you purchase the item succesfully
local declinedialog = 'no' -- dialog when you don't have the money requirement
local owneddialog = 'naw' -- dialog when you already own the item
--- dialog ----
loc.DialogChoiceSelected:connect(function(player,choice)
-- leaderstats --
local stats = player:FindFirstChild('leaderstats')
local backpack = player:WaitForChild('Backpack')
if not stats then return end
local currency = stats:FindFirstChild('Orbitz')
if not currency then return end
-- leaderstats --
if choice == ze then
if backpack:FindFirstChild(item.Name) or player.Character:FindFirstChild(item.Name) then
ze.ResponseDialog = owneddialog
return
end
if currency.Value >=price then
currency.Value = currency.Value - price
item:Clone().Parent = backpack
ze.ResponseDialog = acceptdialog
else
ze.ResponseDialog = declinedialog
end
end
end)
