Hello!
Im trying to figure out how jailbreak “e” prompt on cars, items etc work. I both mean scripting but also the gui thingy how it gets this wobbly thing when its done/denied.
Maybe someone can help?
Thank you.
2 Likes
I haven’t seen the wobbling directly, but I can infer.
The wobbling is using a spring, almost certainly, with low damper.
The E prompt is bound to ContextActionService or UserInputService, and is probably using CollectionService and/or maybe :FindPartsInRegion3() to identify a close part and choose it as the activator.
4 Likes
yeah i mean that the e icon outline grows then shrinks and then resets to normal.
1 Like
Easing.lua (8.0 KB)
^^^^ This module will be needed for it
This must be put in a local script.
local Easing = require(script.Easing) -- location of easing module above
local PulseGui = script.Parent.PulseCircle -- location of the gui you want to "wobble"
local PulseSize = PulseGui.Size
local PulsePos = PulseGui.Position
local IsPulsing = false
function ContextPulse(success)
IsPulsing = true
local startTick = tick()
local rs = game:GetService("RunService").RenderStepped
local total = 0.25
repeat
rs:wait()
local alpha = math.min((tick() - startTick) / total, 1)
local t = Easing.outInBounce(1,0,alpha,1)
local t
if alpha < 0.5 then
t = Easing.outBounce(1,0,alpha*2,1) + 0.5
else
t = Easing.outBounce(1,0,(1-(alpha))*2,1) + 0.5
end
local et = t > 0.5 and (t-0.5)*2 or t*2
PulseGui.Size = UDim2.new(PulseSize.X.Scale,PulseSize.X.Offset+(12*et),PulseSize.Y.Scale,PulseSize.Y.Offset+(12*et))
PulseGui.Position = UDim2.new(PulsePos.X.Scale,PulsePos.X.Offset+(-6*et),PulsePos.Y.Scale,PulsePos.Y.Offset+(-6*et))
until alpha == 1
IsPulsing = false
PulseGui.Size = UDim2.new(PulseSize.X.Scale,PulseSize.X.Offset,PulseSize.Y.Scale,PulseSize.Y.Offset)
PulseGui.Position = UDim2.new(PulsePos.X.Scale,0,PulsePos.Y.Scale,0)
end
4 Likes
Every time I see your engine I always find something else that I end up assimilating into my codebase. This spring class looks really cool, especially since I suck at physics Bookmarked!
3 Likes