Here is my code in a tool with a handle
01 | tool = script.Parent |
02 | handle = tool:WaitForChild( "Handle" ) |
03 |
04 |
05 | tool.Equipped:Connect( function (mouse) |
06 | if mouse then |
07 | mouse.Icon = "rbxassetid://316279304" |
08 |
09 | tool.Activated:connect( function () |
10 | tool.Firing:Play() |
11 | local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Part.CFrame.p).unit* 300 ) |
12 |
13 | local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray, { game:GetService( "Players" ).LocalPlayer.Character,tool.Handle } ) |
14 | --if i use just FindPartOnRay and ignore only the player it will work and hit will not be a null value?? |
15 |