What I am trying to do here is when a tool is equipped and left click is clicked, if the cursor is aiming at fixp, zwire, rwire or gwire, some parts' transparencies should change. This is a localscript and i put it in the tool which is supposed to be equipped:
--Variables
local tool = script.Parent
local fixwire = game.Workspace.bluewirefix
local fixp = game.Workspace.fixp
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local Target = Mouse.Target
local zwire = game.Workspace.zwire
local gwire = game.Workspace.gwire
local rwire = game.Workspace.rwire
--Script
tool.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
if Target == fixp or Target == zwire or Target == gwire or Target == rwire then
zwire.Transparency = 1
fixwire.Transparency = 0
print("g")
end
end)
end)
No errors in output are shown. What am I doing wrong? ;-;

1 comment
Oh. Thank you ^^