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

How do I make a player spawn laying down?

Asked by
RoboFrog 400 Moderation Voter
9 years ago

As the title states, I'm trying to make it to where the player is laying down when they spawn. I'm not exactly requesting a script be made for it, but I'm curious how I'd go about this.

As of now, I'm guessing I'll have to use a PlayerAdded event to trigger it at first, then some sort of Cframe to angle them correctly (or maybe a form of TranslateBy?). However, this is where my knowledge stops, and I'm not quite sure where to go from here.

Thank you for reading, and I look forward to any help possible!

1 answer

Log in to vote
3
Answered by 9 years ago

Well, there are two things that I would try. First, I would do this:

game.Players.PlayerAdded:connect(function(player)
    player.Character.Humanoid.PlatformStand = true
end)

This toggles the "PlatformStand" property of a humanoid, which is often used to "trip" players or make them fall.

The second option is to use a rotation, which would be something like this:

game.Players.PlayerAdded:connect(function(player)
    torso = player.Character.Torso
    torso.CFrame = torso.CFrame * CFrame.fromEulerAnglesXYZ(90, 0, 0)
end)

I'm not exactly sure if those are the right numbers, I always play around with CFrame.fromEulerAngles() a bit before getting it right.

Hope this helps, or at least gets you further to figuring it out!

0
Hmm, PlatformStand isn't quite working for what I needed (with the legs flailing about wildly and whatnot), but that did actually solve another unrelated issue I've been having! As for the second option, it's just what I needed; and I'll agree, remembering CFrame angles is near impossible. Thank you for the help! RoboFrog 400 — 9y
0
torso.CFrame = torso.CFrame * CFrame.Angles(0, 180, 0) I believe. Lacryma 548 — 9y
Ad

Answer this question