local Bin = script.Parent local player = Bin.Parent.Parent function cloak(val) for i, v in pairs(player.Character:GetChildren()) do if v.ClassName == "Part" then v.Transparency = val elseif v.ClassName == "Hat" then v.Handle.Transparency = val end end player.Character.Head.face.Transparency = val end function onKeyDown(key) -- key functions

end

function onButton1Down(mouse) -- click left mouse button if player.Character.Head.Transparency == 0 then cloak(1) else cloak(0) end end

function onButton2Down(mouse) -- click right mouse button

end

function onButton1Up(mouse) -- release left button end

function onButton2Up(mouse) -- release right button

end

function onDeselected() -- when bin is unequipped cloak(0) end

function onSelected(mouse) -- when bin is equipped

mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button2Down:connect(function() onButton2Down(mouse) end)
mouse.Button2Up:connect(function() onButton2Up(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.KeyDown:connect(onKeyDown)

end

Bin.Selected:connect(onSelected) Bin.Deselected:connect(onDeselected)

4 comments

1

Plz use code blocks on the whole script.

0

Also, "Hat" is deprecated. They use "Accessories" now.