something is wrong with this tool
its supposed to switch to other tools...
yet it doesnt
it only selects Hopperbin
so i tried editing it
now it didnt work at all
fix it for 1000 tix
here it is!
local bin = SuperTool
mode = 0
weapons = {}
children = bin:children()
for i=1,#children do
if(className == "HopperBin" or children[i].className == "Tool")
table.insert(weapons,children[i])
end
end
table.sort(weapons,
function (obj1, obj2)
if(obj1.Name < obj2.Name) then return true end
return false
end
)
curTool = weapons[1].Name
function onButton1Down(mouse)
mode = mode + 1
giveTool()
end
function giveTool()
local player = game.Players.LocalPlayer
if player == nil then return end
print("trigger")
if(player.Backpack:findFirstChild(curTool) ~= nil) then player.Backpack[curTool]:remove() end
if(mode > #weapons) then mode = 1 end
if(mode < 1) then mode = #weapons end
weapons[mode]:clone().Parent = player.Backpack
curTool = weapons[mode].Name
end
function keyDown(key)
print(key)
if(key == "q") then
mode = mode - 1
giveTool()
end
end
function onSelected(mouse)
print("select")
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.KeyDown:connect(keyDown)
end
bin.Selected:connect(onSelected)
fix it now for 1000 tix |