Hello, im making a garry’s mod game on Roblox, with source engine games stuff, and ive been stuck on trying to recreate it
the issue is: i cannot negate the fall damage from the repulsion gel, and i want it to bounce you back up the same height as you fell
i did try looking at the forum but there was only 2 posts that did not help me
all i got is this
local part = script.Parent
local multiplier = 1.5 -- Adjust this to control bounce intensity
local debounceTime = 0.2
local debounce = {}
local function onTouched(otherPart)
local character = otherPart.Parent
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
local rootPart = character and character:FindFirstChild("HumanoidRootPart")
if humanoid and rootPart and not debounce[character] then
debounce[character] = true
local incomingVelocity = rootPart.Velocity.Y
local bounceForce = math.abs(incomingVelocity) * multiplier
rootPart.AssemblyLinearVelocity = Vector3.new(rootPart.AssemblyLinearVelocity.X, bounceForce, rootPart.AssemblyLinearVelocity.Z)
task.delay(debounceTime, function()
debounce[character] = nil
end)
end
end
part.Touched:Connect(onTouched)
i came up with some debugging and delete the character and character thing but it still doesnt work
local part = script.Parent
local multiplier = 1.5 -- Adjust this to control bounce intensity
local debounceTime = 0.2
local debounce = {}
print("Running")
local function onTouched(otherPart)
local character = otherPart:GetRootPart().Parent
local rootPart = character:FindFirstChild("HumanoidRootPart")
if rootPart and not debounce[character] then
print("checked")
debounce[character] = true
local incomingVelocity = rootPart.Velocity.Y
local bounceForce = math.abs(incomingVelocity) * multiplier
rootPart.AssemblyLinearVelocity = Vector3.new(rootPart.AssemblyLinearVelocity.X, bounceForce, rootPart.AssemblyLinearVelocity.Z)
print("Bounced")
task.delay(debounceTime, function()
debounce[character] = nil
end)
end
end
part.Touched:Connect(onTouched)
everything is printing correctly and when it needs to, its just, not bouncing
it kind of works, but only when i hold jump, and the force isnt fast enough, it lags a bit, enough to make me take fall damage robloxapp-20250307-1856471.wmv (5.0 MB)