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

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

Asked by 3 years ago

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?

0
Please research ahead of time. The answer to your problem was a simple wait() function; you would've found the needed information easily. Ziffixture 6913 — 3y
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. Ziffixture 6913 — 3y
0
However, this would drastically affect the gravity. Ziffixture 6913 — 3y

Closed as Not Constructive by Dovydas1118 and DinozCreates

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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!

Ad