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

Player floats in air, can you help?

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

✓ Accepted answer

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

2 comments

0

If this solves your problem, please mark it as the answer! ;>

0

It worked, thank yuo so much1 Now I can start my game!

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