So basically, with this script I either bounce little to none at all or way too much from large enough heights, what can I do?
local Changed = function(part, PropertyName, func)
local current = part[PropertyName]
local elapsedTime = 0
coroutine.resume(coroutine.create(function()
while true do
repeat elapsedTime = elapsedTime + task.wait() until part[PropertyName] ~= current
local v,v2 = coroutine.resume(coroutine.create(function()
return func(part[PropertyName], current, elapsedTime)
end))
if v2 == "stop" then break end
elapsedTime = 0
current = part[PropertyName]
end
end))
end
local y = 0
local hum = game.Players.LocalPlayer.Character.Humanoid
Changed(hum.RootPart, "CFrame", function(cf)
if cf.Y > y then
y = cf.Y
end
end)
Changed(hum, "FloorMaterial", function(mat)
if mat ~= Enum.Material.Air then
hum.RootPart.Velocity = Vector3.new(hum.RootPart.Velocity.X, (y-hum.RootPart.CFrame.Y), hum.RootPart.Velocity.Z) -- the "bounce" part
y = hum.RootPart.CFrame.Y
end
end)

1 comment
I wanna know how to make this without instances so I can re-create this for my minecraft mod eheheh