• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Global exhaust

Sun

Knowledge is power - France is bacon
Joined
Jan 26, 2015
Messages
334
Solutions
22
Reaction score
249
Hi there.

I'll be very thankful if someone can teach me how to set a global exhaust.

I made this so when you step on a couch it says "fuck yo couch".
So far I've added 1 sec of individual exhaust, but I'd like it to be global.
I'm fairly new to scripting and nothing I've tried has worked so far.

Code:
function onStepIn(cid, item, position, fromPosition)
local storage = 1000
local time = 1 -- seconds
if(exhaustion.check(cid, storage) == false) then
doCreatureSay(cid, "Fuck yo couch!", TALKTYPE_ORANGE_1)
exhaustion.set(cid, storage, time)
end
end

thanks in advance :)
 
Code:
local storage = 45001
local seconds = 5
function onStepIn(cid, item, position, fromPosition)
   time = os.time()
   if getGlobalStorageValue(storage)+seconds < time then
     setGlobalStorageValue(storage, os.time())
     doCreatureSay(cid, "Caress thou couch!", TALKTYPE_ORANGE_1)
   else
     return FALSE
   end
   return TRUE
end
Code:
local storage = 45001
local seconds = 5
function onStepIn(cid, item, position, fromPosition)
   time = os.time() -- os.time() = your operating system time
   if getGlobalStorageValue(storage)+seconds < time then -- if your operating systems time has not went 5 seconds since the last time this script was activated, then continue to else. Otherwise continue with script
     setGlobalStorageValue(storage, os.time()) -- set global storage 45001 as your operating system time.
     doCreatureSay(cid, "Caress thou couch!", TALKTYPE_ORANGE_1) -- send text
   else -- if.. if statement is not true then do this
     return false -- return false, aka do nothing
   end -- end if statement
   return true -- return OnStepIn function
end -- end function.
 
Last edited by a moderator:
Back
Top