[FREE] [OX] WX Hospital - NPC doctor that can heal you or sell medicals!

static (2)

Hello everyone! Today I am releasing another free script, which is WX Hospital! This is a simple OX based script with NPC doctor. He can heal you or sell medicals (bandages and medikit). The script is as always open source and contains simple config where you can customize almost everything!

:arrow_double_down: [DOWNLOAD HERE] GitHub

It would be complicated to explain everything, so I made a short showcase of the whole script.

SHOWCASE

Features

  • OX Integration (Target, Inventory, Lib)
  • 0.00ms resmon!
  • Medicals Shop
  • Integrated simple cheater protection
  • Large config file
  • OPEN SOURCE

Requirements

Config File

My other scripts

[PAID] WX AntiCheat 2.0

[FREE] WX Core - Essential script pack
[FREE] WX Users - Admin utility to see player id, name and status
[FREE] WX Blips - Simple blip creator
[FREE] WX Reports - Simple Chat-based report system with built-in admin-only chat

2 Likes

Doesn’t work I have to restart the script while players are nearby to actually see the doctor, and when they press regsiter they do all the animaions and it “revives” them kinda but they still have the distress call thing in front of them.

1 Like

I have the same thing, I need to restart the script to make the doctor and the menu appear

I have the same issue, dont see the doctor npc, cant make the people heal

Great idea, I just need to remove the functionality for buying supplies and paying for healing as we don’t use inventory/money on our server. That aside, I popped open the github and gotta ask, what is going on with your fxmanifest? Why are you loading the configs multiple times? You have the client_scripts loading configs/*.lua which is loading the config and webhook config, you have the server_scripts loading the webhook config again, and then you have shared_scripts loading the config and webhook config again??? Also, don’t handle webhooks on the client side, they are extremely exploitable if you do that! Webhooks should be handled server side only and if the config_hospital needs to be done on both, just list it under the shared scripts.

Also, another idea to consider, instead of just having a default configged amount of time for them to be in the bed, you could get their current health and subtract that from a full health of 200 then multiply that result by 500 or 1000 or whatever you want to get a duration of time to heal for. This way the more injured they are, the longer it takes to heal.

1 Like

hey, thanks for the suggestions, I don’t have much time right now for my free resources but if you’d like you can create the PR. about the manifest, iirc I copied some other resource’s folder when I was making the resource lmao

Just Modify the peds.lua


Citizen.CreateThread(function ()
    for k,v in pairs(wx.Peds) do
        RequestModel(v.Model)

        while not HasModelLoaded(v.Model) do
            Wait(500)
        end

        doctor = CreatePed(0,v.Model,v.Coords.x-0.21,v.Coords.y,v.Coords.z-1,v.Heading,false,true)
        FreezeEntityPosition(doctor, true)
        SetEntityInvincible(doctor,true)
        SetBlockingOfNonTemporaryEvents(doctor,true)
        TaskStartScenarioInPlace(doctor,'PROP_HUMAN_BUM_SHOPPING_CART',0,true)
        local options = {
            {
                name = 'wx_hospital:register',
                event = 'wx_hospital:job',
                distance = wx.MinDistance,
                icon = 'fa-solid fa-briefcase-medical',
                label = wx.Lang.TargetRegister,
            },
        }
        exports.ox_target:addModel(v.Model, options)
    end
end)

Thats the fix and thanks for this script ^^


Citizen.CreateThread(function ()
    for k,v in pairs(wx.Peds) do
        RequestModel(v.Model)

        while not HasModelLoaded(v.Model) do
            Wait(500)
        end

        doctor = CreatePed(0,v.Model,v.Coords.x-0.21,v.Coords.y,v.Coords.z-1,v.Heading,false,true)
        FreezeEntityPosition(doctor, true)
        SetEntityInvincible(doctor,true)
        SetBlockingOfNonTemporaryEvents(doctor,true)
        TaskStartScenarioInPlace(doctor,'PROP_HUMAN_BUM_SHOPPING_CART',0,true)
        local options = {
            {
                name = 'wx_hospital:register',
                event = 'wx_hospital:job',
                distance = wx.MinDistance,
                icon = 'fa-solid fa-briefcase-medical',
                label = wx.Lang.TargetRegister,
            },
        }
        exports.ox_target:addModel(v.Model, options)
    end
end)
1 Like

¿Cómo podría configurar para que los que presionen en revivir se hagan spawn en otra cama que no este desocupada?
How could I configure so that those who press revive spawn in another bed that is not unoccupied?