Tool.Activated Not Working?

   script.Parent.Activated:Connect(shoot)

The code doesnt work and doesnt print anything

1 Like

You haven’t provided enough context to know how you structured the script. Maybe you didn’t put in the correct function? Maybe you even put the script in a different place other than the tool root?

The function is above the Activated event also the function works perfectly when i add it in a equipped event

script.Parent.Activated:Connect(function()
    shoot()
end)

Doesnt work it doesnt even print

could you prove the full script cuz idk what the hell you’re trying to make

local function shoot()
	
	if plr.Character:FindFirstChild(script.Parent.Name) then
		
		vievModel.Shoot:Play()
	end
end 

script.Parent.Activated:Connect(function()
	print("e")
	shoot()
end)

Do i need to show you variables too?

you spelled viewModel wrong maybe?

As i said at the top the function works the problem is that the “Activated” Event doesnt even fire.

You could theoretically get the tool to fire when UserInputService detects a click instead of the tool.

Question is, are you doing it using a localscript or a normal one?

1 Like

If the tool doesn’t have a handle then disable the Tool.RequiresHandle.

I am doing it in a local script

It does have a handle

image

How does the player get the tool?

The tool is in a starterPack for now

Okay but how does the player get the tool in their Backpack?

From the “StarterPack” Service

Maybe try using an server script? As for now i will investigate further.

Okay, so correct me if I’m wrong, but to sum it up;
.Equipped is firing, and so does .Unequipped, right?

As I have mentioned before, why not use UserInputService when the tool is equipped? You can track the equipping with .Equipped and unequipping the same way with .Unequipped.