Hello, when I try to use the Tool.Activated function, it doesnt detect any sort of activation being made but it should?
Here are the scripts
Local:
local plr = game.Players.LocalPlayer
local tool = script.Parent
local event = script.RemoteEvent
tool.Activated:Connect(function()
print("activated")
event:FireServer(plr)
end)
It does not print activated
Server Script:
local animFolder = script.Parent.Parent:WaitForChild("Animations")
local slash1 = animFolder.Slash1
local slash2 = animFolder.Slash2
local slash3 = animFolder.Slash3
local debounce = false
script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr)
print("yes")
local char = plr.Character
local humanoid = char:FindFirstChild("Humanoid")
if humanoid then
local animTrack1 = humanoid:LoadAnimation(slash1)
animTrack1.Priority = Enum.AnimationPriority.Action
local animTrack2 = humanoid:LoadAnimation(slash2)
animTrack2.Priority = Enum.AnimationPriority.Action
local animTrack3 = humanoid:LoadAnimation(slash3)
animTrack3.Priority = Enum.AnimationPriority.Action
local sounds = {
script.Parent.Parent.Handle.Slash1,
script.Parent.Parent.Handle.Slash2,
script.Parent.Parent.Handle.Slash3
}
local currentAnimationIndex = 1
print("activated")
if debounce == true then return end
debounce = true
sounds[currentAnimationIndex]:Play()
currentAnimationIndex += 1
if currentAnimationIndex > 3 then
currentAnimationIndex = 1
end
if currentAnimationIndex == 1 then
animTrack3:Stop()
task.wait()
animTrack1:Play()
script.Parent.Parent.Handle.Trail.Enabled = true
task.wait(.5)
script.Parent.Parent.Handle.Trail.Enabled = false
print("done")
elseif currentAnimationIndex == 2 then
animTrack1:Stop()
task.wait()
animTrack2:Play()
script.Parent.Parent.Handle.Trail.Enabled = true
task.wait(.5)
script.Parent.Parent.Handle.Trail.Enabled = false
print("done2")
elseif currentAnimationIndex == 3 then
animTrack2:Stop()
task.wait()
animTrack3:Play()
script.Parent.Parent.Handle.Trail.Enabled = true
task.wait(.5)
script.Parent.Parent.Handle.Trail.Enabled = false
print("done3")
end
task.delay(.25, function()
debounce = false
end)
end
end)
Same here, nothing is being printed.
Here are the tool’s behaviour settings.
If anyone knows the problem, please help me.