bloob827Join Date: 2010-08-01 Post Count: 6867 |
Ok.. this is in a hopperbin and when you click it, you heal to full health, but when you use it the hopperbin disappears, but the mouseIcon is still on :/
Script :
bin = script.Parent
Debounce = false
function onButton1Down(mouse)
local player = game.Players.LocalPlayer
if player == nil then return end
if (Debounce == false) then
Debounce = true
local h = player.Character:findFirstChild("Humanoid")
h.Health = h.Health + 100
end
bin:Remove()
end
function onSelected(mouse)
mouse.Icon = "http://www.roblox.com/asset/?id=36152562"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected) |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
bump |
|
ApocalypsJoin Date: 2009-02-15 Post Count: 816 |
bin = script.Parent
Debounce = false
function onButton1Down(mouse)
local player = game.Players.LocalPlayer
if player == nil then return end
if (Debounce == false) then
Debounce = true
local h = player.Character:findFirstChild("Humanoid")
h.Health = h.Health + 100
end
bin:Remove()
end
function onSelected(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected) |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
No i want the icon.. |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
bump |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
bump! |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
bum |
|
|
You can't do anything about the cursor when the tool removes
just switch to a different tool then put the different tool away |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
That wasn't much help...
I only have this tool ONLY. |
|
SpectrumwJoin Date: 2009-08-04 Post Count: 13510 |
@Shred
You fail so epicly... of course you can remove the cursos when the tool is gone, that is why 'Deselected' event exists. |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
The hopperbin is gone once it is used. |
|
SpectrumwJoin Date: 2009-08-04 Post Count: 13510 |
Deselected function is used when the tool is gone or deselected. |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
Ok.
bin = script.Parent
Debounce = false
function onButton1Down(mouse)
local player = game.Players.LocalPlayer
if player == nil then return end
if (Debounce == false) then
Debounce = true
local h = player.Character:findFirstChild("Humanoid")
h.Health = h.Health + 100
end
bin:Remove()
end
function onSelected(mouse)
mouse.Icon = "http://www.roblox.com/asset/?id=36152562"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
bin.Selected:connect(onSelected)
bin.Deselected:connect(function() mouse.Icon:Remove() end)
That? |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
BUMP? |
|
KrammyJoin Date: 2008-06-29 Post Count: 3599 |
bin.Deselected:connect(function(mouse) mouse.Icon = "" end)
|
|
KrammyJoin Date: 2008-06-29 Post Count: 3599 |
bin = script.Parent
function onButton1Down(mouse)
local player = game.Players.LocalPlayer
if player == nil then return end
local h = player.Character:findFirstChild("Humanoid")
h.Health = h.MaxHealth
mouse.Icon = ""
bin:Remove()
end
bin.Selected:connect(function(mouse)
mouse.Icon = "http://www.roblox.com/asset/?id=36152562"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end) |
|
|
u need a cursor remover thingy be4 the tool deletes itself |
|