This does not work on play mode but it works on solo mode. The script works perfectly fine except the the dialog response does not change on play mode why?

script.Parent.DialogChoiceSelected:connect(function(player, choice)
-----------------------------------------------------------
local cash = 250
local item = "RocketJumper"
local location = script.Parent.ze.THING
local savable = true
local bought = "horay"
local declined = "nope"
local owned = "stop buying more"
------------------------------------------------------------
    local stats = player:FindFirstChild('leaderstats')
    if not stats then return end

    local Money = stats:FindFirstChild('Orbitz')
    if not Money then return end
------------------------------------------------------------

    if choice == script.Parent.ze.THING then  
        if player.Backpack:FindFirstChild(item) or player.Character:FindFirstChild(item) then
        location.ResponseDialog = (tostring(owned))
        return
        end
        if Money.Value >= cash then 
            Money.Value = Money.Value - cash
 			game.ReplicatedStorage.Resources.Purchases:FindFirstChild(item):Clone().Parent=player.Backpack
			location.ResponseDialog = (tostring(bought))
            else
           	location.ResponseDialog = (tostring(declined))
        end
    end
end)

2 comments

0

Is it a local script?

0

no its not I tryed using a local script but it didn't work