[Release] [Standalone] Pillbox Beds

This script allows you to lie down on the bed.

Disable animation: F1

Working with: Pillbox Hospital Interior (MLO) and Pillbox Hospital by Jobscraft

Download

8 Likes

Is there a possibility that can be done so when lying down there is something that shows that you have to press F1 to get up??

I’m almost 100% sure 2 versions of this were already released.

Look into “DrawText”

nice love your work

Add this on line 34 of Main.lua to add instructional holographic text for getting out of the bed

		elseif OnBed then
			local BedCoords = GetEntityCoords(CurrentBed)
			Draw3DText({x = BedCoords.x, y = BedCoords.y, z = (BedCoords.z+1)}, 'Press ~g~[F1] ~w~to get up', 0.35)

He does not stop lying down properly

you need to press F1 to get up ,

i think it would be better to change get up button to E

i made some edit so you can getup with E and disable X button


Citizen.CreateThread(function()
	while true do
		Citizen.Wait(5)

		if CurrentBed ~= nil and IsControlJustReleased(0, 38) and not OnBed then

			local PlayerPed = PlayerPedId()
			local BedCoords, BedHeading = GetEntityCoords(CurrentBed), GetEntityHeading(CurrentBed)

			LoadAnimSet('missfbi1')

			SetEntityCoords(PlayerPed, BedCoords)
			SetEntityHeading(PlayerPed, (BedHeading+180))

			TaskPlayAnim(PlayerPed, 'missfbi1', 'cpr_pumpchest_idle', 8.0, -8.0, -1, 1, 0, false, false, false)
			OnBed = true
		elseif IsControlJustReleased(0, 38) and IsEntityPlayingAnim(PlayerPedId(), 'missfbi1', 'cpr_pumpchest_idle', 3) and OnBed then
			ClearPedTasks(PlayerPedId())

			OnBed = false
		end
	end
end)
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if CurrentBed ~= nil then
			if OnBed then
				DisableControlAction(0, 323, true)
			end
		end
    end
end)
1 Like

I found the mistake. It was up to the resource “krz_personalmenu” if I turn this off it goes

what the hell dude this is pretty much the same as mine ( which may I add was done first) Pillbox beds

you have just changed the cords

thank youu

Where do you see the coords in my script? Or bed list?

as much as it coded different is still pretty much as what I released lol … anyway nice job

Did a little update. On most RP servers, ‘X’ is the way most people cancel things, and ‘F1’ is to open your phone, however, simply switching the control from F1 to X didn’t work as the cancel event also checks if the player is doing the animation, which, when you press X, it does the hands up animation.

Anyone wanting to use X to cancel it, replace this:

elseif IsControlJustReleased(0, 73) and IsEntityPlayingAnim(PlayerPedId(), 'missfbi1', 'cpr_pumpchest_idle', 3) then

with this

elseif IsControlJustReleased(0, 105) and OnBed == true then

This basically just checks if they are on the bed or not, then X works fine to stand up. It will also mean that if someone cancels it some other way, the next time they put their hands up (with RPers tend to do a lot) it will set OnBed to false so they can use other beds and not accidentally teleport themselves to the bed by pressing E.

1 Like

Can’t you make a warehouse for hospital housing their goods inside And then people can come with medications and bandages and Mette kids because now you have made so much for the pill box so it could also fit in so that the doors open and then there was a leather in it because then one could get medicine down there https://gyazo.com/467af1fde9e58a327a4b4f26aea13cf1 https://gyazo.com/1bbad34d711a4cbd2a184ed79f992fbe hope you can do it good day:mask:

How i can change this? because i press E in the the hospital and the script teleport me to the bed hehe

yeah, this script is really broken. I deleted it… :confused:

Could you make others using same feature for sofas beds benches chairs?

Example: Sofa and the apartment bed