local Dialog = script.Parent
Dialog.DialogChoiceSelected:Connect(function(player, choice)
local stats = player:FindFirstChild("leaderstats")
if not stats then return end
local Stomps = stats.Stomps
if not Stomps then return end
if choice == script.Parent.Shop.TeddyChoice then
if Stomps.Value >= 5 then
local TeddyClone = game.ReplicatedStorage.Teddy:Clone()
TeddyClone.Parent = player.Backpack
Stomps.Value = Stomps.Value - 5
print("Purchase Success")
end
end
end)
This is my code, I was creating a thing where if you select a dialog choice for one of the characters in my game, you get a tool in your backpack if you pay 5 "Stomps" from the leader stats.
But nothing happens, the tool isn't in my backpack, there is no error in the output, it doesn't print my message, I've tried to change a lot of things but nothing new in the output and nothing worked. I hope somebody can help me figure this out! Thank you

2 comments
Did you use a Server or Local Script?
This is a server script