Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Mad bloxxer sword?

Asked by
axis95 0
9 years ago

I cant get the sword to work. Im having trouble. Ive managed to make it do the equipping animation but i cant make the sword swing. Help?

**-- Made by axis95 SwordScript

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 SwordLocalScript

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)**

-- Theres a problem but i cant spot it and the output bar isnt helping :c

Answer this question