So, I have this figure in which you talk to him to buy the weapons. Now when you buy it you receive it fine, but when you die or reset, it's gun and to get it again you have to buy it again. How can I fix this? Thanks!
01 | script.Parent.DialogChoiceSelected:connect( function (player, choice) |
02 | if (choice:findFirstChild( "Cost" )) then |
03 | if (player.leaderstats.Money.Value > = choice.Cost.Value) then |
04 | if (game.Lighting:findFirstChild(choice.Name)) then |
05 | player.leaderstats.Money.Value = player.leaderstats.Money.Value - choice.Cost.Value |
06 | local gun = game.Lighting:findFirstChild(choice.Name):clone() |
07 | if (gun.className = = "Panzerfaust" ) then |
08 | gun.Parent = player.Backpack |
09 | else |
10 | gun.Parent = player.Character |
11 | end |
12 | end |
13 | end |
14 | end |
15 | end ) |
01 | script.Parent.DialogChoiceSelected:connect( function (player, choice) |
02 | if (choice:findFirstChild( "Cost" )) then |
03 | if (player.leaderstats.Money.Value > = choice.Cost.Value) then |
04 | if (game.Lighting:findFirstChild(choice.Name)) then |
05 | player.leaderstats.Money.Value = player.leaderstats.Money.Value - choice.Cost.Value |
06 | local gun = game.Lighting:findFirstChild(choice.Name):clone() |
07 | if (gun.className = = "Panzerfaust" ) then |
08 | gun.Parent = player.StarterGear |
09 | else |
10 | gun.Parent = player.Character |
11 | end |
12 | end |
13 | end |
14 | end |
15 | end ) |
StarterGear Will hold if they reset