Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with making a bouncy character script *without* creating instances?

Asked by 2 years ago
Edited 2 years ago

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?

01local Changed = function(part, PropertyName, func)
02    local current = part[PropertyName]
03    local elapsedTime = 0
04 
05    coroutine.resume(coroutine.create(function()
06        while true do
07            repeat elapsedTime = elapsedTime + task.wait() until part[PropertyName] ~= current
08 
09            local v,v2 = coroutine.resume(coroutine.create(function()
10                return func(part[PropertyName], current, elapsedTime)
11            end))
12 
13            if v2 == "stop" then break end
14            elapsedTime = 0
15            current = part[PropertyName]
View all 33 lines...
0
I wanna know how to make this without instances so I can re-create this for my minecraft mod eheheh RedWirePlatinum 53 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Actuallyyyyyyyy... I figured it out, lol

01local y = 0
02local hum = game.Players.LocalPlayer.Character.Humanoid
03Changed(hum.RootPart, "Velocity", function(vel)
04    task.wait()
05    y = vel.Y
06end)
07 
08Changed(hum, "FloorMaterial", function(mat)
09    if mat ~= Enum.Material.Air then
10        hum.RootPart.Velocity = Vector3.new(hum.RootPart.Velocity.X, math.abs(y)*0.9, hum.RootPart.Velocity.Z) -- the "bounce" part
11        y = hum.RootPart.CFrame.Y
12    end
13end)
Ad

Answer this question