Enhance your FiveM server with the RP Beds—a simple yet immersive script that lets NPCs go to bed and sleep. Perfect for roleplay servers that want to add more realism and life to their world!
Features
Dynamic Bed Interaction
Peds will smoothly approach and lie down on beds for a realistic touch.
Customizable configuration
Choose options, custom events and add/remove beds in the config.
Option to add custom actions when player is lying like in the example video
Option to add custom beds (2 vectors for left side and 2 vectors for right side)
Easy Integration
Works with all FiveM frameworks. Simple setup and ready to go!
Preview
In this video I added 2 examples actions
Highly performant
Script is dormant most of the time with 0.0ms and only works inside interiors with a base of 0.02ms and only gets up to 0.05ms when near a bed due to the internal code handling vectorial math.
I do not need a switch function, can you perhaps add a quit function? What about a home system like Loaf, where I can place beds anywhere in the house?
You can place beds anywhere and configure the script in the config to add all the beds you want.
The scripts wants 4 vectors for left side and 4 vectors for right side (in case you want to add both)… that’s for the precision of the animations.
2 vectors for the angled area, 1 start animation vector, 1 aimation rotation vector
Also the switch function is just an example you can add your custom actions to the script, the actions you see in the video when the ped lays down are an example.
You can add your own “quit” action when sleeping
Might be a stupid question but is it possible, or will it be in the future- to make it object oriented aswell not just pure coordinations? Or maybe it is already I don’t know but it’d make it a bit more usable for those of us who use housing systems that allow, or rather encourage self furnishing.
Very cool and, to me, usable script nonetheless- just a bit more so if that was a possibility!
To maintain compatibility with R* beds, which are not props, And since animations want coordinates and not entity IDs I made it vectors compatible this ensures you can add the animation on any type of bed whatever bed it is not being bound to the entities allows the animation to be wider compatible
I may experiment and see if I can only do the animation position and rotation making it only 2 vectors per bed side but natives are pretty petty in these situation… I can’t promise
Sadly I can’t make it “prop” oriented
EDIT: i was able to decrease the number of vectors sadly i can’t make it better than this because animations wants vectors not the prop id
Decreased number of vectors per each bed side from 4 to 2,
Now each side only requires the AnimationStart vector and AnimationRotation vector.
Added AddBed, RemoveBed, EditBed exports to allow scripters to add, modify, remove beds dynamically via exports in code (useful for when a bed is moved around)
Updated config and removed weird game coordinates from vanilla beds.
Price has been decreased due to various requests. I appreciate your interest in this script thanks for all the suggestions and advices i’m receiving
I mean some people’s resources use custom animations that people have to hand animate or port from other games. This is a neat script, it just doesn’t make much sense to charge for it if it’s a simple function directly from the base game. There’s plenty of examples of free scripts that just make base game functionality work in FiveM (Working gates, telescopes, etc)
Porting animations from other games is against TOS isn’t it?
Anyway thanks after 7+ year of community free sharing I was definitely unaware of the other scripts! So I thought “why not? After releasing scaleforms maybe a little script that make every custom bed possibly customizable with the vanilla animations with exports and smoothness is not a big deal”… Now that you told me it’s definitely a different situation