local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteFLD = ReplicatedStorage:WaitForChild("Remote_FLD")
local ActiveRemote = RemoteFLD:WaitForChild("Lightning_Remote")
local VFXFLD = ReplicatedStorage:WaitForChild("VFX_TESTFOLD")
ActiveRemote.OnServerEvent:Connect(function(player, action, target)
if action == "Strike" then
local character = player.Character
if not character then return end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoidRootPart or not humanoid then return end
if not target or not target.Parent then return end
local targetHRP = target.Parent:FindFirstChild("HumanoidRootPart")
if not targetHRP then return end
local EHum = target.Parent:FindFirstChild("Humanoid")
local lightning = VFXFLD:FindFirstChild("Electricity Impact")
if not lightning then return end
local lightningClone = lightning:Clone()
lightningClone.CFrame = targetHRP.CFrame * CFrame.new(0, 0, 0)
lightningClone.Anchored = true
lightningClone.CanCollide = false
lightningClone.Parent = workspace
local mainFolder = lightningClone:FindFirstChild("Main")
if lightningClone and mainFolder then
for _, emitter in pairs(mainFolder:GetChildren()) do
if emitter:IsA("ParticleEmitter") then
emitter.Parent = lightningClone -- move emitters to BasePart to display particles
emitter:Emit(5)
print("yepo")
end
end
end
EHum:TakeDamage(12)
game:GetService("Debris"):AddItem(lightningClone, 223)
end
end)