My dialog shop isn't working?(rewrite)
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
1 | local KOs = stats:FindFirstChild( 'KOs' ) |
)')
if not KOs then return end
01 | if choice = = script.Parent.DialogChoice.Throwing BOMB then |
02 | if KOs.Value > = 10 then |
03 | game.ReplicatedStorage.Weapon 1 :Clone().Parent = player.Backpack |
04 | KOs.Value = KOs.Value - 10 |
06 | elseif choice = = dialog.DialogChoice.Darkheart then |
07 | if KOs.Value > = 100 then |
08 | game.ReplicatedStorage.Weapon 2 :Clone().Parent = player.Backpack |
09 | KOs.Value = KOs.Value - 100 |
11 | elseif choice = = dialog.DialogChoice.Heat seeking missile launcher then |
12 | if KOs.Value > = 500 then |
13 | game.ReplicatedStorage.Weapon 3 :Clone().Parent = player.Backpack |
14 | KOs.Value = KOs.Value - 500 |
16 | elseif choice = = dialog.DialogChoice.Red scythe then |
17 | if KOs.Value > = 50 then |
18 | game.ReplicatedStorage.Weapon 5 :Clone().Parent = player.Backpack |
19 | KOs.Value = KOs.Value - 50 |
21 | elseif choice = = dialog.DialogChoice.Knife then |
22 | if gold.Value > = 100 then |
23 | game.ReplicatedStorage.Weapon 4 :Clone().Parent = player.Backpack |
24 | gold.Value = KOs.Value - 100 |
end)
I want a fixed script