Hello devs! Currently I am making a power where you create an explosion, dealing 350 damage to those in the agro distance. It also shakes the players camera. For this, I used sleitnicks camera shake module with the preset being explosion. However, when you use the attack, not only does it not damage, but it also waits awhile before having the shake happen. Ive tried debugging, to no avail.
Here is my current server code (pretty much handles it all)
--//Services
local RS = game:GetService("ReplicatedStorage")
local SSS = game:GetService("ServerScriptService")
local TS = game:GetService("TweenService")
--//Variables
local unr_slam = RS:WaitForChild("REMOTES").UNRELIABLE.ATTACKS.BURNING_WISHES.SLAM
local unr_shake = RS:WaitForChild("REMOTES").UNRELIABLE.ATTACKS.BURNING_WISHES.SHAKE_CAMERA
local tool = script.Parent
local impact_sound = tool.Impact
local swoosh_sound = tool.Swoosh
local weld_module = require(SSS.BACK_END.MODULES.WELD_MODULE)
--damage increments
local agro_distance = 10;
--//OnServerEvent
unr_slam.OnServerEvent:Connect(function(player)
local character = player.Character
local right = character:WaitForChild("Right Arm")
local humanoid = character:WaitForChild("Humanoid")
local human_root = character:WaitForChild("HumanoidRootPart")
local orb = RS:WaitForChild("VFX_PARTS").ORB:Clone()
local impact = RS:WaitForChild("VFX_PARTS").IMPACT:Clone()
swoosh_sound:Play()
--orb
orb.Transparency = 1
TS:Create(orb, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Transparency = 0}):Play()
humanoid.Jump = true
orb.Parent = character
local weld = weld_module:weld(right, orb)
task.wait(0.73)
impact_sound:Play()
--impact
impact.Transparency = 1
impact.Parent = workspace
TS:Create(impact, TweenInfo.new(0.75, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Transparency = 0}):Play()
impact.Position = human_root.Position + Vector3.new(0, -3, 0)
for _, object in ipairs(workspace:GetChildren()) do
local torso = object:FindFirstChild("Torso") or object:FindFirstChild("HumanoidRootPart")
local human = object:FindFirstChild("Humanoid")
if (human) and (torso) then
if ((character.PrimaryPart.Position - torso.Position).magnitude < agro_distance) and (human.Health > 0) then
local character = torso.Parent
local plr = game.Players:GetPlayerFromCharacter(character)
print("fired")
unr_shake:FireClient(plr)
if (torso.Parent ~= character) and (human.Parent ~= character) then
human:TakeDamage(350)
end
task.wait(1.5)
orb:Destroy()
impact:Destroy()
end
end
end
end)
Here is a video showing the issue
Any help is appreciated