I've been recently working non-stop trying to fix this but I couldn't none of them worked so I've found out what its doing so I don't know how to stop it. Okay what it does is that when you click it the DialogResponse is to slow to react before it actually happends. What I mean by that is lets say the DialogResponse is 'hi' then its suppose to change to 'no' but when I click it. It says 'hi' then the next time whens its suppose to change to something different it says 'no'. I'm sorry for explaining this horribly
any help?
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)
