so I have multiple hammers and I want it to be like if you have a certain amount of energy the archivable becomes true for the fire hammer and the rusted hammer archivable becomes false. Here is the script raid6n gave me.
1 | local plr = game.players.localplayer |
2 | local tool = script.parent |
3 | local power = plr.leaderstats.power |
4 | if tool.Parent = = plr.Backpack then |
5 | power + = 500 |
6 | end |
1 | local plr = game.Players.LocalPlayer |
2 | local tool = script.parent |
3 | local Energy = plr.leaderstats.Energy |
4 | if Energy = < 500 then |
5 | tool.Parent = game.Starterpack |
6 | end |
similar to what raid said
01 | local plr = game.Players.LocalPlayer |
02 | local rustHammar = --whatever it is |
03 | local fireHammar = script.Parent |
04 | local Energy = plr.leaderstats.Energy |
05 |
06 | while true do |
07 | if Energy = < 500 then |
08 | tool.Parent = plr.Backpack |
09 | rustHammar.Archivable = true |
10 | break |
11 | end |
12 | end |