local light = script.Parent.Light local pointlight = light.PointLight local tool = script.Parent local click = script.Parent.Handle.Click local equip = script.Parent.Handle.Equip tool.Equipped:connect(function() equip:Play() tool.Activated:connect(function() light.Material = "Neon" light.BrickColor = BrickColor.new("New Yeller") pointlight.Enabled = not pointlight.Enabled click:Play() end) tool.Unequipped:connect(function() light.Material = "Glass" light.BrickColor = BrickColor.new("Medium stone grey") pointlight.Enabled = false click:Play() end) end)
This script works when its first equipped, but i reequip it it stops working until i equip it again.
Also how can I make the neon work?
tool.Equipped:Connect(function(mouse) equip:Play() mouse.Button1Down:Connect(function() light.Material = Enum.Material.Neon light.BrickColor = BrickColor.new"New yeller" pointlight.Enabled = not pointlight.Enabled click:Play() end) end) tool.Unequipped:Connect(function() -- No mouse parameter! Common mistake to add it. -- code end)
Enum
properties (such as material) with strings, but with enum.