local time = 5 -- minutes
local function doSendPlayerTimeMessage(cid)
if isPlayer(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Thirty seconds until your disguise breaks!")
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
doRemoveItem(item.uid, 1)
doSetMonsterOutfit(cid, "necromancer costume", time * 1000 * 60)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Five minutes until your disguise breaks!")
-- doPlayerSendTextMessage(cid, 20, "Five minutes until your disguise breaks!")
addEvent(doSendPlayerTimeMessage, 4.5 * 60 * 1000, cid)
return true
end
--[[
function is basically telling the server to 'run' this thing.. which is located in source.
In this case it's a onUse script.. the rest is just stuff to easily call things in the script.
cid = the player or creature using the object.
item, is the item being used
fromPosition/toPosition is based on location of cid/item
itemEx is used when you use an item on something. (a shovel on the ground.. a rune on a player)
Inside the main function you can call pre-made functions and stuff
doRemoveItem.. does exactly what is says.. .uid stand for uniqueID .. which every object has a different uid.
Most of the rest is simply trial and error if your just starting out
Idk how to explain it.. but if you want to learn more, look online for lua tutorials, or coding tutorials in general.
]]--