I edited the script but it didn't work so here's the new script( I rewrited the question because I thought that noone will reply still if I edited the old one)
local dialog = script.Parent dialog.DialogChoiceSelected:connect(function(player, choice) -- Check the player has a stats object local stats = player:FindFirstChild('leaderstats') if not stats then return end
local KOs = stats:FindFirstChild('KOs')
)') if not KOs then return end
if choice == script.Parent.DialogChoice.Throwing BOMB then if KOs.Value >= 10 then game.ReplicatedStorage.Weapon1:Clone().Parent = player.Backpack KOs.Value = KOs.Value - 10 end elseif choice == dialog.DialogChoice.Darkheart then if KOs.Value >= 100 then game.ReplicatedStorage.Weapon2:Clone().Parent = player.Backpack KOs.Value = KOs.Value - 100 end elseif choice == dialog.DialogChoice.Heat seeking missile launcher then if KOs.Value >= 500 then game.ReplicatedStorage.Weapon3:Clone().Parent = player.Backpack KOs.Value = KOs.Value - 500 end elseif choice == dialog.DialogChoice.Red scythe then if KOs.Value >= 50 then game.ReplicatedStorage.Weapon5:Clone().Parent = player.Backpack KOs.Value = KOs.Value - 50 end elseif choice == dialog.DialogChoice.Knife then if gold.Value >= 100 then game.ReplicatedStorage.Weapon4:Clone().Parent = player.Backpack gold.Value = KOs.Value - 100 end end
end)
I want a fixed script