Skip to content

Commit

Permalink
Well
Browse files Browse the repository at this point in the history
  • Loading branch information
TerbSEC committed Dec 31, 2019
1 parent e90d8fe commit 72da9be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 15 additions & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local PlyLastPos = 0
local Anim = 'sit'
local AnimScroll = 0

-- // WHEN YOU ARE OUT OF RANGE, TICK EVERY MS!
-- // WHEN YOU ARE OUT OF RANGE, IT DOSENT TICK EVERY MS!
local canSleep = false

CreateThread(function()
Expand Down Expand Up @@ -121,6 +121,20 @@ CreateThread(function()
end
end)

CreateThread(function()
while Config.Healing ~= 0 do
Wait(Config.Healing*1000)
if inUse == true then
if ObjectAr.fObjectIsBed == true then
local health = GetEntityHealth(oPlayer)
if health <= 199 then
SetEntityHealth(oPlayer,health+1)
end
end
end
end
end)

RegisterNetEvent('ChairBedSystem:Client:Animation')
AddEventHandler('ChairBedSystem:Client:Animation', function(v, objectcoords)
local object = v.fObject
Expand Down
1 change: 0 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Config = {}

Config.Healing = 3 -- // If this is 0, then its disabled.. Default: 3.. That means, if a person lies in a bed, then he will get 1 health every 3 seconds.
Config.Cooldown = 2 -- // If this is 0, then its disabled.. Default: 2.. That means, if a player goes and stand up, then he need to wait 2 seconds, before he can lay/sit again! [VERY RECOMMENDED]

Config.objects = {
ButtonToSitOnChair = 58, -- // Default: G -- // https://docs.fivem.net/game-references/controls/
Expand Down

0 comments on commit 72da9be

Please sign in to comment.