Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local _C = {
- --] Basic Configuration
- ["MaxDamage"] = 2643;
- ["MinDamage"] = 6235;
- ["Cooldown"] = 1;
- ["Cost"] = 0;
- --] Advanced
- ["HumanoidToKill"] = ("Enemy")
- }
- return _C
- ---------------------------------------------------------------------------------------------------------------------------------------------------
- if (j and (j.Part0 == Handle or j.Part1 == Handle)) then
- if (not enemy) then return end
- game.ReplicatedStorage.GameRemotes.DamageEvent:FireServer(hit,enemy,Tool)
- end
- wait(_M.Cooldown)
- debounce = false
- end
- end
- end
- end
- function onActivated()
- if (not Tool.Enabled) then return end
- Tool.Enabled = false
- local chr = Tool.Parent
- local hum = chr:FindFirstChild("Humanoid")
- local anim = hum:LoadAnimation(script.Parent.Slash)
- if (hum == nil) then return end
- SlashSound:Play()
- anim:Play()
- script.Parent.Unequipped:Connect(function()
- anim:Stop()
- end)
- wait(_M.Cooldown)
- Tool.Enabled = true
- end
- function onEquipped()
- if (not Tool) then return end
- if (not Handle) then return end
- if Handle.UnsheathSound.IsPlaying == false then
- Handle.UnsheathSound:Play()
- end
- end
- function onUnequipped()
- if (not Tool) then return end
- if (not Handle) then return end
- Handle.UnsheathSound:Stop()
- end
- function checkValue()
- if valueCooldown == false then
- valueCooldown = true
- script.CanDamage.Value = true
- wait(_M.Cooldown)
- wait()
- script.CanDamage.Value = false
- valueCooldown = false
- end
- end
- script.Parent.Activated:Connect(onActivated)
- script.Parent.Activated:Connect(checkValue)
- script.Parent.Equipped:Connect(onEquipped)
- script.Parent.Unequipped:Connect(onUnequipped)
- connection = Handle.Touched:Connect(SwordCore)
- ------------------------------------------------------------------
- function weld()
- local parts,last = {}
- local function scan(parent)
- for _,v in pairs(parent:GetChildren()) do
- if (v:IsA("BasePart")) then
- if (last) then
- local w = Instance.new("Weld")
- w.Name = ("%s_Weld"):format(v.Name)
- w.Part0,w.Part1 = last,v
- w.C0 = last.CFrame:inverse()
- w.C1 = v.CFrame:inverse()
- w.Parent = last
- end
- last = v
- table.insert(parts,v)
- end
- scan(v)
- end
- end
- scan(script.Parent)
- for _,v in pairs(parts) do
- v.Anchored = false
- end
- end
- weld()
- script:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement