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

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

Asked by 4 years ago

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.

0
Could you explain a bit more? User#30811 0 — 4y
0
Oh i understand. User#30811 0 — 4y
0
Is this something you wanted? https://gyazo.com/d0f44e8f6356e87ce56d666916152de6 User#30811 0 — 4y
0
so basically a one way platform jaydeplay150 20 — 4y

2 answers

Log in to vote
1
Answered by
compUcomp 417 Moderation Voter
4 years ago
Edited 4 years ago

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
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. LiquidGaming 33 — 4y
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. compUcomp 417 — 4y
0
Oh, thank you! LiquidGaming 33 — 4y
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". compUcomp 417 — 4y
0
Glad I could help :D compUcomp 417 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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!

0
That would fire with contact from any part, not just a character. compUcomp 417 — 4y
0
It also doesn't look like it resets once the player ends contact. compUcomp 417 — 4y
0
Yes i have realized my mistake. User#30811 0 — 4y
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 compUcomp 417 — 4y
View all comments (2 more)
0
He can always change the wait time, anyways im gonna update my script. User#30811 0 — 4y
0
There, i edited the script. User#30811 0 — 4y

Answer this question