#How to use player.backpack and clickdetector in same script

2 messages · Page 1 of 1 (latest)

crystal cedar
#
--Variables
local rock = script.Parent
local highlight = rock.Highlight
local clickdetector = rock.ClickDetector
local plr = ..............
local backpack = plr:WaitForChild('Backpack')

clickdetector.MouseHoverEnter:Connect(function()
    if rock.Equipped then
      highlight.Enabled = true
end)
clickdetector.MouseHoverLeave:Connect(function()
    if rock.unequipped then
      highlight.Enabled = false
end)
#

?