if pART.Touched then
wait(1)
--here is the touched script
local velocity = Instance.new("BodyVelocity")
task.wait(2)
velocity.Parent = Player.Character.HumanoidRootPart
velocity.Velocity = Vector3.new(0,40.0)
wait(1)
velocity:Destroy()
end
Just cause the main thread to yield for 2 seconds before parenting the BodyVelocity instance.
This seems like a bit overcomplicated script you’re managing, why not just check if the Tornado isn’t touching your own Player by using game.Players:GetPlayerFromCharacter(), referencing a table to see who touched it, and using a Connection?
local Properties = {
Velocity = 100,
Duration = 0.25,
Cooldown = 1,
}
game.Lighting.RuzgarDalgasiRemote.OnServerEvent:Connect(function(Player)
local Part = game.Lighting.RuzgarTest:Clone()
Part.CFrame = Player.Character.HumanoidRootPart.CFrame
Part.Position = Player.Character.Head.Position
Part.CanCollide = false
Part.CanTouch = false
Part.Parent = workspace
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) --No need to multiply as math.huge is an EXTREMELY high number
BodyVelocity.Velocity = Part.CFrame.LookVector * Properties.Velocity
BodyVelocity.Parent = Part
local Connection
local Tagged = {}
local function PlayerHit(Hit)
if Hit.Parent and Hit.Parent:FindFirstChild("HumanoidRootPart") then
local PlayerTarget = game.Players:GetPlayerFromCharacter(Hit.Parent)
if PlayerTarget and PlayerTarget ~= Player and not table.find(Tagged, PlayerTarget) then
table.insert(Tagged, PlayerTarget)
local Velocity = Instance.new("BodyVelocity")
Velocity.Velocity = Vector3.new(0, 40, 0)
Velocity.Parent = Hit.Parent.HumanoidRootPart
wait(1)
Velocity:Destroy()
end
end
end)
Connection = Part.Touched:Connect(PlayerHit)
coroutine.resume(coroutine.create(function()
while Part.Parent == workspace do
Part.CFrame *= CFrame.fromEulerAnglesXYZ(0, 0.3, 0)
game:GetService("RunService").Heartbeat:Wait()
end
end))
wait(Properties.Duration)
Connection:Disconnect()
Part:Destroy()
end)
There were a couple of other minor issues I noticed, but go ahead and try this