local Debounce = {}
function onTouched(hit)
if not hit.Parent:FindFirstChildOfClass("Humanoid") then return end
local hrp = hit.Parent:FindFirstChild("HumanoidRootPart")
if hrp then
if Debounce[hrp] then return end
Debounce[hrp] = true
local attch = Instance.new("Attachment", hrp)
local LinearVelocity = Instance.new("LinearVelocity", hrp)
LinearVelocity.MaxForce = math.huge
LinearVelocity.Attachment0 = attch
LinearVelocity.VectorVelocity = Vector3.new(0, 6.5, 0)
task.wait(6)
Debounce[hrp] = nil
attch:Destroy()
LinearVelocity:Destroy()
end
end
part.Touched:Connect(onTouched)```
My friend helped me with this script cause Im not good with physics but I want it so that when the player levitated they can also move around. If thats even possible.
#Levitation script for players
1 messages · Page 1 of 1 (latest)
I guess if there is a different type of Velocity i can use or a setting i can toggle
u can create a part a player can walk on
Its basically like supposed to be what happens when u get hit by a shulker projectile in minecraft. Player levitated upwards for a while and then come back down. But while the velocity is in effect the player cant move
thats my issue
change LinearVelocity.MaxForce = math.huge to ```
lv.ForceLimitMode = Enum.ForceLimitMode.PerAxis
lv.MaxAxesForce = Vector3.new(0, math.huge, 0)
so it will only change on the Y axis
ok