Message
Message
local TS = game:GetService("TweenService")
part.Parent = mChar
part.CFrame = mChar.HumanoidRootPart.CFrame
local w = Instance.new("WeldConstraint")
w.Part0 = mChar.HumanoidRootPart
w.Part1 = part
w.Parent = part
part:SetNetworkOwner(plr)
-- Create ForceField
local ff = Instance.new("ForceField")
ff.Name = "ForceField2"
ff.Visible = false
ff.Parent = mChar
-- Track hits
local hitDBs = {}
hitDBs[hitChar] = true
task.delay(1.5, function() hitDBs[hitChar] = nil end)
-- Visuals
local zapSound = Instance.new("Sound")
zapSound.SoundId = "http://www.roblox.com/asset/?id=318154687"
zapSound.Volume = 1.5
zapSound.Parent = hitChar.HumanoidRootPart
zapSound:Play()
game.Debris:AddItem(zapSound, 2)
hitHum:TakeDamage(100)
end
end
-- Check collisions
local loop = true
task.spawn(function()
while loop do
task.wait(0.1)
local touchings = GetTouchingParts(part)
for _, v in ipairs(touchings) do
if v.Parent and v.Parent:FindFirstChild("Humanoid") and not
hitDBs[v.Parent] then
applyForce(v)
end
end
end
end)
mChar.Humanoid.Died:Connect(disconnect)
end