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

How would I go about making a semi-solid platform?

A semi-solid platform is a platform that you can jump up through but you can't clip through it when you're on top of it. I have no clue how I would even start this, so any help would be majorly appreciated.

4 comments

0

Could you explain a bit more?

0

Oh i understand.

0
0

so basically a one way platform

2 answers

✓ Accepted answer

I haven't tested this idea, but I think you might be able to pull it off. Each of these semi-solids should have CanCollide set to false. Tag all of your semi-solids with CollectionService and on the client, loop through them and listen for Touched events. Inside the client touched event, check for collisions with that client's character's feet. Wait a preset time (this will require a little tweaking) and locally set CanCollide to true. You'll also want to check for the player ending their contact with the part and disable CanCollide accordingly. Since the client owns the character's position, they will appear to be standing on top of the semi-solid to all the other clients as well, even though their local version of the part has CanCollide set to false. If you need further clarification, I can write out this idea and test the code. See below

Tag Editor: https://www.roblox.com/library/948084095/Tag-Editor

Mark your semisolids with a tag called "Semisolid".

Implementation located in StarterPlayerScripts (yes, it's local):

local cs = game:GetService("CollectionService")
for _, v in pairs(cs:GetTagged("Semisolid")) do
	v.Touched:Connect(function (p)
		if p.Name:find("Foot") and p.Parent == script.Parent.Parent.Character then
			wait(0.1)
			v.CanCollide = true
			coroutine.wrap(function ()
				while wait(1) do
					local stillTouching = false
					for _, part in pairs(v:GetTouchingParts()) do
						if part.Parent == p.Parent then
							stillTouching = true
							break
						end
					end
					if not stillTouching then
						v.CanCollide = false
						break
					end
				end
			end)()
		end
	end)
end

5 comments

0

I'm still new to scripting, and I don't understand most of this. Also I would like to make it so 1 player can jump on it, and while they're standing on it another player can come and jump on top of it.

0

Yes, this implementation would allow for that since CanCollide is being set locally. I'll write it out for you and update my post in a few minutes.

0

Oh, thank you!

0

I've tested it with two players and it works. Just install the Tag Editor plugin included in my post and mark your semisolids with a tag called "Semisolid".

0

Glad I could help :D

A semi-solid platform. I am new to scripting but i think this could help. To make it, make the part you want to jump thro. Disable collisions for the part. Then insert a script in the part you will jump to and put in this script.

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
	wait(0.1)
        script.Parent.CanCollide = true
        script.Parent.Script:Destroy()
    end
end)

I hope this helps!

6 comments

0

That would fire with contact from any part, not just a character.

0

It also doesn't look like it resets once the player ends contact.

0

Yes i have realized my mistake.

0

And then there's the case where the player's head just pops through but isn't enough to jump onto the platform... You're on the right track though

0

He can always change the wait time, anyways im gonna update my script.

0

There, i edited the script.

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