I already have this tool that’s been working for the past couple months however recently I’ve switched to making the tool animated properly, with a bodyattach and an M6D that connects the tool with the hand and HandleRequired turned off so that the animation may work properly. However with this change I’m not able to activate the tool what-so-ever.
local plr = game:GetService("Players").LocalPlayer
local deb = false
local anim
local anim2
local char = plr.Character
local mouse
local dist
local opponent
local player
local ammo = true
local check = true
local reserves = 3
script.Parent.Activated:Connect(function()
print("hey")
mouse = plr:GetMouse()
if reserves > 0 then
if ammo == true then
ammo = false
script.Parent.load:FireServer()
print ("dispensed")
script.Parent.audio:FireServer()
reserves = reserves - 1
if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
dist = (mouse.Hit.p - script.Parent.ShootPart.Position).Magnitude
if dist < 50 then
opponent = mouse.Target.Parent
script.Parent.RemoteEvent:FireServer(opponent,plr)
end
end
else
if check == true then
check = false
print ("reloading")
wait (2.5)
ammo = true
script.Parent.load:FireServer()
check = true
print ("loaded")
end
end
else
script.Parent.unload:FireServer()
end
end)
Here is that full LocalScript.
Here’s the tool and it’s children.
It does not print the “hey” I want it to print, where do I go from here?