Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local debris = game:GetService("Debris")
- local ins = table.insert
- local events = {}
- local playerdb = {}
- game.ReplicatedStorage.Remotes.Kicking.OnServerEvent:Connect(function(player)
- if not playerdb[player] then
- playerdb[player] = true
- coroutine.resume(coroutine.create(function()
- wait(2.8)
- playerdb[player] = false
- end))
- local character = player.Character
- if not character or character.Humanoid.Health <= 0 then return end
- local left = game.ReplicatedStorage.LegHitbox:Clone()
- local ws = Instance.new("WeldConstraint")
- ws.Part0 = character.LeftLowerLeg
- ws.Part1 = left
- ws.Parent = left
- debris:AddItem(left, 0.3)
- left.Position = character.LeftLowerLeg.Position
- left.Parent = character.LeftLowerLeg
- local right = game.ReplicatedStorage.LegHitbox:Clone()
- ws = Instance.new("WeldConstraint")
- ws.Part0 = character.RightLowerLeg
- ws.Part1 = right
- ws.Parent = right
- debris:AddItem(right, 0.35)
- right.Position = character.RightLowerLeg.Position
- right.Parent = character.RightLowerLeg
- local hits = {}
- local touch = function(hit)
- if hit:FindFirstAncestorOfClass("Model") and hit:FindFirstAncestorOfClass("Model"):FindFirstChildWhichIsA("Humanoid") then
- local char = hit:FindFirstAncestorOfClass("Model")
- if not hits[char] and char:FindFirstChildWhichIsA("Humanoid").Health > 0 then
- hits[char] = true
- char:FindFirstChildWhichIsA("Humanoid"):TakeDamage(math.random(50,80))
- end
- end
- end
- local t = left.Touched:Connect(touch)
- local tr = right.Touched:Connect(touch)
- ins(events, t)
- ins(events, tr)
- coroutine.resume(coroutine.create(function()
- wait(0.30)
- for i,v in next, events do v:Disconnect() end
- end))
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement