Hi, i have make a telekinesis power but i don’t know why it’s don’t work and it’s dosen’t send me any error in the output
here is my script in a server script:
local RE = game:GetService("ReplicatedStorage")
local PowerEvent = RE.Power
local Speed = 70
local Force = 95000
local TotalForce = Force
local ragdollModule = require(RE.RagdollModule)
PowerEvent.OnServerEvent:Connect(function(client ,Power, State, target, ClientHRP, MouseHit, ClientChar)
if Power == "TelePunching" then
if State == "Begin" then
local Range = 200
local HRP = game.Workspace[client.Name].HumanoidRootPart
local KnockBack = Instance.new("BodyVelocity")
local EnnemyCharacter = target.Parent
if EnnemyCharacter then
local EnnemyHRP = EnnemyCharacter:FindFirstChild("HumanoidRootPart")
if EnnemyHRP then
if (HRP.Position - EnnemyHRP.Position).Magnitude <= Range then
print("3")
KnockBack.Parent = EnnemyCharacter:FindFirstChild("HumanoidRootPart")
KnockBack.MaxForce = Vector3.new(TotalForce,TotalForce,TotalForce)
KnockBack.Velocity = HRP.CFrame.LookVector * Speed
--RE.Ragdoll:FireClient(game.Players:GetPlayerFromCharacter(EnnemyCharacter))
wait(0.55)
KnockBack:Destroy()
wait(2.5)
--RE.Ragdoll:FireClient(game.Players:GetPlayerFromCharacter(EnnemyCharacter))
end
end
end
end
end
end
the Print don’t show
Here is what happens in game: