script.Parent.Activated:Connect(shoot)
The code doesnt work and doesnt print anything
script.Parent.Activated:Connect(shoot)
The code doesnt work and doesnt print anything
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?
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
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.