The top one is the main script while the bottom is the local script.
-- Made by axis95
local tool = script.Parent
local speedboost = 1.25
local damage = 100
local swingtime = 1
local combowindown = .5
local handle = tool:WaitForChild("Handle")
local event = tool:WaitForChild("RemoteEvent")
local slashsound = handle:WaitForChild("SlashSound")
local Overheadsound = handle:WaitForChild("OverheadSound")
local LungeSoundsound = handle:WaitForChild("LungeSoundSound")
local lastclick = tick()
local combo = 0
handle.Touched:connect(function(hit)
if equipped and character and humanoid and humanoid.Health > 0 and hit and not hit:IsDescendantOf(character) then
local targethumanoid = hit.Parent:FindFirstChild("Humanoid")
if targethumanoid and targethumanoid.Health > 0 and not hithumanoids[targethumanoid] then
hithumanoids[targethumanoid] = true
targethumanoid:TakeDamage(damage * combo)
end
end
end)
tool.Activated:connect(function()
local clickdelta = tick() - lastclick
if clickdelta > swingtime then
lastclick = tick()
hithumanoids = {}
if clickdelta < swingtime + combowindow then
combo = (combo + 1) % 3
else
combo = 0
end
if player then
if combo == 0 then
event:FireClient(player, "RunAnimation", "SlashAnim2")
slashsound:Play()
elseif combo == 1 then
event:FireClient(player, "RunAnimation", "ThrustAnim2")
Overheadsound:Play()
elseif combo == 2 then
event:FireClient(player, "RunAnimation", "OverheadAnim2")
LungeSoundsound:Play()
end
end
end
end)
tool.Equipped:connect(function()
equipped = true
lastclick = tick()
combo = 0
player = game.Players:GetPlayerFromCharacter(character)
humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = humanoid.WalkSpeed * speedboost
else
character = nil
end
end)
tool.Unequipped:connect(function()
equipped = false
if humanoid then
humanoid.WalkSpeed = humanoid.WalkSpeed / speedboost
end
character = nil
humanoid = nil
end)
----------------------------------------------------------------------------------------
-- Made by axis95
local tool = script.Parent
local event = tool:WaitForChild("RemoteEvent")
event.OnClientEvent:connect(function(...)
local tuple = (...)
if tuple[1] == "RunAnimation" then
local anim = tool:FindFirstChild(tuple[2])
if anim and humanoid then
local loadedanim = humanoid:LoadAnimation(anim)
if loadedanim then
loadedanim:Play()
if themouse then
themouse.Icon = "rbxasser://textures\\GunWaitCursor.png"
wait(1)
themouse.Icon = "rbxasser://textures\\GunCursor.png"
end
end
end
end
end)
tool.Equipped:connect(function(mouse)
themouse = mouse
humanoid = tool.Parent:FindFirstChild("Humanoid")
if humanoid then
local anim = tool:FindFirstChild("IdleAnim3")
if anim and humanoid then
if loadedidleanim then
loadedidleanim:Stop()
end
local loadedidleanim = humanoid:LoadAnimation(anim)
if loadedidleanim then
loadedidleanim:Play()
end
end
local anim = tool:FindFirstChild("EquipAnim")
if anim and humanoid then
local loadedanim = humanoid:LoadAnimation(anim)
if loadedanim then
loadedanim:Play()
end
end
end
if themouse then
themouse.Icon = "rbxasser://textures\\GunCursor.png"
end
end)
tool.Unequipped:connect(function()
if loadedidleanim then
loadedidleanim:Stop()
end
end)
--I can get the equip function to work but I can't get it to swing. Any help?
I cant get it to swing for some reason. I re written it twice and checked it a bunch of times. Any help?

1 comment
Check your spelling for the mouse icon changes.