hey so im trying to make it so my script does something in this function once it recieves a remote event firing, the event fires but nothing seems to happen.
here’s the code, im not really sure what went wrong but there arent any errors
local weaponinfo = {
physical = true,
fist = true,
damage = 4.5,
}
local tool = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
if player then
local character = player.Character
local handlerfolder = character:WaitForChild("handlerfolder")
local remfolder = handlerfolder:WaitForChild("Remotes")
local m1 = remfolder:WaitForChild("M1")
m1.OnServerEvent:Connect(function(plr)
local player = game:GetService("Players"):GetPlayerFromCharacter(tool.Parent)
if player then
local character = player.Character
local Humanoid = character.Humanoid
local setupfolder = character.setupfolder
local combo = setupfolder.Combo
local combotimer = setupfolder.ComboTimer
local function checkForStun(festy)
for _, tag in pairs(festy) do
if character:FindFirstChild(tag) then
return true
end
end
end
if checkForStun({"Stun", "Action", "Knocked", "Blocking", "Casting"}) then return end
if tick() - combotimer.Value > 2.25 then
combo.Value = 0
end
if combo.Value >=4 then
combo.Value = 3
end
combotimer.Value = tick()
combo.Value += 1
local animation = Humanoid:LoadAnimation(ReplicatedStorage.Animations:FindFirstChild("Hit".. combo.Value))
animation:Play()
task.wait(0.35)
if combo.Value >=4 then
weaponinfo.knockback = true
weaponinfo.ragdoll = true
end
end
end)
end