Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can I make the cursor icon not appear as clickable while hovering over button that is in 'cooldown'?

Asked by 5 years ago
Edited 5 years ago

Hello, I'm trying to make the cursor icon look default during the 'cooldown' process of the script while hovering over a clickable object.


local ShirtID = script.Parent.Parent.Holder.Shirt.ShirtTemplate local cPart = script.Parent local cDetector = script.Parent.ClickDetector local CanClick = true local function onClicked(player) if not CanClick then return end CanClick = false print(player.Name.." attempted to wear Alfa Uniform") local foundShirt = player.Character:FindFirstChild("Shirt") if not foundShirt then print(player.Name.." failed to wear Alfa Uniform") local newShirt = Instance.new("Shirt",player.Character) newShirt.Name = "Shirt" else if foundShirt then print(player.Name.." succesfuly wore Alfa Uniform") player.Character.Shirt:Destroy() local newShirt = Instance.new("Shirt",player.Character) newShirt.Name = "Shirt" end end player.Character.Shirt.ShirtTemplate = ShirtID wait(2) CanClick = true end local function onHoverEnter(player) cPart.Transparency = .177 cPart.BrickColor = BrickColor.White() end local function onHoverLeave(player) cPart.BrickColor = BrickColor.White() cPart.Transparency = 1 end cDetector.MouseHoverEnter:connect(onHoverEnter) cDetector.MouseHoverLeave:connect(onHoverLeave) cDetector.MouseClick:connect(onClicked)

Answer this question