Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a part that if player touches part, player falls slowly for 20 sec?

pls dont delete my question :( I used this;

script.Parent.Touched:Connect(function(h) if h.Parent:FindFirstChild("Humanoid") then game.Workspace.Gravity = 005 end end)

I want a timer that 20 seconds later gravity becomes normal. Can someone help, please?

3 comments

0

Please research ahead of time. The answer to your problem was a simple wait() function; you would've found the needed information easily.

0

Furthermore, "005" is recognized as an integer of 5 making the zeros redundant. If you were looking to assign a floating-point value, you must represent the data as a decimal: 0.05.

0

However, this would drastically affect the gravity.

1 answer

✓ Accepted answer

Hello!

This is quite simple to do, all you are required to do is add a wait(20) function to your gravity change script. After this time is over we can make the gravity go back to normal like before!

local Part = script.Parent

Part.Touched:Connect(function(Hit)
	if Hit.Parent:FindFirstChild("Humanoid") then
		workspace.Gravity /= 2 -- divides the deafult gravity by 2 so that it gives a slow fall effect
		wait(20)
		workspace.Gravity = 196.2
	end
end)

Hope this helps!

This discussion is preserved as it was. New answers, comments, and votes are closed.