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

How to make so you spawn in a bed and wake up there?

player = Game.Players["Abandion"]

player.CharacterAdded:Connect(function(chr)

chr:SetPrimaryPartCFrame(game.Workspace.Bed.CFrame)

end

Like how to make so when you join you spawn at in a bed and sleep. And like the screen is like when your eyes opening and then you wake up?

Please answer.

You can answer at discord also ( HugoRoblox #4646 )

Thanks.

5 comments

0

To pull this off, you will need animations, screen guis, and a lot of code

0

If you have some scripting we can look at, please post it in this post.

0

I scripted ( player = Game.Players["Abandion"] player.CharacterAdded:Connect(function(chr) chr:SetPrimaryPartCFrame(game.Workspace.Bed.CFrame) end

0

Apologies but I meant, post the script in your post with the edit button. Once you hit the edit button, there should be a lua button you can click... between the lines, put the entire script... then save that edit. Done deal.

0

I did it.

2 answers

Use the CharacterAdded event of Player to fire a function when they respawn

player = Game.Players["Abandion"]

player.CharacterAdded:Connect(function(chr)
  chr:SetPrimaryPartCFrame(game.Workspace.Bed.CFrame)
end

2 comments

0

Please explain a bit more, like step by step. I'm new to script. I'm normally a designer.

0

If you want them to "wake up" every time they respawn use CharacterAdded, as it fires when the character is rebuilt/added, rather than the player, which is added once and removed once when they join and leave respectively.

Alright so I can't really do much as I don't have a bed model at the moment nor am at a PC but I can tell you what you need to do.

What you can do to fix this...

Try making a function that can be called when the bed is touched that does what you need it to do. You could try making an if-statement so it doesn't repeat over and over again every time they spawn on the bed. See if either of these fixes your issue. Apologies that I couldn't fix your script but I hope this helps a bit.

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