I’m trying to make an NPC using dialogs that increases a value and resets some values.
However, the script isn’t even detecting when the player opens the dialog at all.
This is the script that I have:
script.Parent.Dialog.DialogChoiceSelected:Connect(function(player, pick)
print("reply")
local stats = player:WaitForChild("leaderstats")
local level = stats:WaitForChild("Level")
local prestige = stats:WaitForChild("Prestige")
if (pick == script.Parent.Dialog.PrestDialogChoice.Catch.Proceed1.Proceed2.Confirm) then
print("attempting")
local stats = player:WaitForChild("leaderstats")
local level = stats:WaitForChild("Level")
local tickets = stats:WaitForChild("Tickets")
local exp = stats:WaitForChild("exp")
local expr = stats:WaitForChild("expremaining")
local prestige = stats:WaitForChild("Prestige")
local pcredits = stats:WaitForChild("P-Credits")
local multi = stats:WaitForChild("Multiplier")
if level.Value >= (50 + (prestige.Value * 5)) then
print("reqs met")
pcredits.Value = pcredits.Value + ((20 + (level.Value - (50 + (prestige.Value * 5)))))
multi.Value = multi.Value + ((math.floor(tickets.Value / 50000)) / 100)
tickets.Value = 0
level.Value = 1
exp.Value = 0
expr.Value = 1000
local h = player.Parent:FindFirstChild("Humanoid")
h.Health = 0
end
end
)
end)
None of the prints are triggered.
This is what it looks like in the directory:
Can anyone please tell me how I can get the script to detect when the player interacts with the dialog?