local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
local stats = player:FindFirstChild('leaderstats')
if not stats then return end
local old = stats:FindFirstChild('Cash')
if not Cash then return end
if choice == script.Parent.DialogChoice.ChoiceA then
if Cash.Value >= 500 then
game.ReplicatedStorage.Weapon1:Clone().Parent = player.Backpack
Cash.Value = Cash.Value - 500
end
I want this script to give a "Bat" when you speak to it and have enough money. I have this script and its inside the NPC's head any suggestions: Here are some more screenshots of what i've done:
