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

Player floats in air, can you help?

Asked by 3 years ago

So, I'm making a game where, after a random number of seconds, a block dissapears, in the air, with the player on it. I need the player to fall, but it floats in the air, meaning that the part just turns transparent, it doesn't disappear. Here is my current code:

    Part=script.Parent -- the part

    while wait (math.random (1,3) ) do -- repeat this loop every (random) seconds
    Part.Transparency=1
    wait(math.random(1,5)) -- wait between 1 to 5 seconds
    Part.Transparency=0
    end

I need the player to fall. Can you help me? Thanks!

1 answer

Log in to vote
0
Answered by 3 years ago

You need to change the CanCollide property of the part along with the transparency. This property decides whether or not a player can collide with a part. Here is the previous answer taking that into account;

Part=script.Parent -- the part

while wait(14) do -- repeat this loop every 14 seconds
Part.Transparency=1
Part.CanCollide=false
wait(math.random(6,12)) -- wait between 6 to 12 seconds
Part.Transparency=0
Part.CanCollide=true
end
0
If this solves your problem, please mark it as the answer! ;> Galvarino 25 — 3y
0
It worked, thank yuo so much1 Now I can start my game! pugguy1000 3 — 3y
Ad

Answer this question