• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Adding date+time that item was made

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
How do i add time to an item? i have a command !sex, it have chances to make a baby, how can i make it add time on the babies? let me knw if u know :) if i have to post the script let me know too, !
 
LUA:
doItemSetAttribute(item, "description", "Baby was born on "..os.date("%A %B %d %X %Y", os.time())..".")
Instead of item add the variable of the doPlayerAddItem.

If you want to change the date/time, this is what everything means.
Code:
%a	abbreviated weekday name (e.g., Wed)
%A	full weekday name (e.g., Wednesday)
%b	abbreviated month name (e.g., Sep)
%B	full month name (e.g., September)
%c	date and time (e.g., 09/16/98 23:48:10)
%d	day of the month (16) [01-31]
%H	hour, using a 24-hour clock (23) [00-23]
%I	hour, using a 12-hour clock (11) [01-12]
%M	minute (48) [00-59]
%m	month (09) [01-12]
%p	either "am" or "pm" (pm)
%S	second (10) [00-61]
%w	weekday (3) [0-6 = Sunday-Saturday]
%x	date (e.g., 09/16/98)
%X	time (e.g., 23:48:10)
%Y	full year (1998)
%y	two-digit year (98) [00-99]
 
Last edited:
LUA:
doItemSetAttribute(item, "description", "Baby was born on "..os.date("%A %B %d %X %Y", os.time())..".")
Instead of item add the variable of the doPlayerAddItem.

If you want to change the date/time, this is what everything means.
Code:
%a	abbreviated weekday name (e.g., Wed)
%A	full weekday name (e.g., Wednesday)
%b	abbreviated month name (e.g., Sep)
%B	full month name (e.g., September)
%c	date and time (e.g., 09/16/98 23:48:10)
%d	day of the month (16) [01-31]
%H	hour, using a 24-hour clock (23) [00-23]
%I	hour, using a 12-hour clock (11) [01-12]
%M	minute (48) [00-59]
%m	month (09) [01-12]
%p	either "am" or "pm" (pm)
%S	second (10) [00-61]
%w	weekday (3) [0-6 = Sunday-Saturday]
%x	date (e.g., 09/16/98)
%X	time (e.g., 23:48:10)
%Y	full year (1998)
%y	two-digit year (98) [00-99]

I'm not sure where to put that at, ;s can you tell me? :x thanks
 
Where it adds the baby/doll.
Btw if it already has a description, just add the text to the other description.
 
Last edited:
Code:
%a	abbreviated weekday name (e.g., Wed)
%A	full weekday name (e.g., Wednesday)
%b	abbreviated month name (e.g., Sep)
%B	full month name (e.g., September)
%c	date and time (e.g., 09/16/98 23:48:10)
%d	day of the month (16) [01-31]
%H	hour, using a 24-hour clock (23) [00-23]
%I	hour, using a 12-hour clock (11) [01-12]
%M	minute (48) [00-59]
%m	month (09) [01-12]
%p	either "am" or "pm" (pm)
%S	second (10) [00-61]
%w	weekday (3) [0-6 = Sunday-Saturday]
%x	date (e.g., 09/16/98)
%X	time (e.g., 23:48:10)
%Y	full year (1998)
%y	two-digit year (98) [00-99]

Where do you get that kind of codes?
 
Alright thats the script, it gave me an error in the log when i tried to use it so maybe you can help me,
-Do i have to put the Code anywhere? o.o
Code:
local combat = createCombatObject()
local condition = createConditionObject(CONDITION_DROWN)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 20, 2000, -10)
setCombatCondition(combat, condition)

function onSay(cid, words, param)
sexProposal = getPlayerStorageValue(cid, 66600)
sexAccept = cid
noCondom = math.random(4)
aidsEffect = math.random(3)

	local playerPos = getCreaturePosition(cid)
	if getPlayerLookDir(cid) == 1 then 
		posDir = {x = playerPos.x + 1, y = playerPos.y, z = playerPos.z, stackpos = 253}
	elseif getPlayerLookDir(cid) == 2 then
		posDir = {x = playerPos.x, y = playerPos.y + 1, z = playerPos.z, stackpos = 253}
	elseif getPlayerLookDir(cid) == 3 then
		posDir = {x = playerPos.x - 1, y = playerPos.y, z = playerPos.z, stackpos = 253}
	else
		posDir = {x = playerPos.x, y = playerPos.y - 1, z = playerPos.z, stackpos = 253}
	end
	target = getThingfromPos(posDir)
	if isPlayer(target.uid) == TRUE then
		if getPlayerLookDir(target.uid) == getPlayerLookDir(cid)-2 then
			sameLookDir = TRUE
		elseif getPlayerLookDir(target.uid) == getPlayerLookDir(cid)+2 then
			sameLookDir = TRUE
		else
			sameLookDir = FALSE
		end
		if sameLookDir == TRUE then
			if getPlayerSex(target.uid) == getPlayerSex(cid) then
				doPlayerSendCancel(cid, 'Fag.')
				doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
			else
				if getPlayerGroupId(cid) > 3 and getPlayerGroupId(cid) >= getPlayerGroupId(target.uid) then
					sexProposal = cid
					sexAccept = target.uid
					allowSex = TRUE
				elseif target.uid == sexProposal then
					allowSex = TRUE
				else
					allowSex = FALSE
				end
				if allowSex == TRUE then
					if getPlayerStorageValue(sexProposal, 66660) > 0 or getPlayerStorageValue(sexAccept, 66660) > 0 then
						doSendAnimatedText(getCreaturePosition(sexProposal), 'Ahh, Ahh...', TALKTYPE_ORANGE_1)
						doSendMagicEffect(getPlayerPosition(sexProposal),CONST_ME_STUN)
						doSendAnimatedText(getThingPos(sexAccept), 'Ohh, Ohh!', TALKTYPE_ORANGE_1)
						doSendMagicEffect(getPlayerPosition(sexAccept),CONST_ME_STUN)
						setPlayerStorageValue(sexProposal, 66660, 0)
						setPlayerStorageValue(sexAccept, 66660, 0)
					else
						if noCondom == 3 then
							hurtMessage = 'You got AIDS.'
							partnerMessage = 'Your partner just got AIDS.'
							bothMessage = 'Both of you got AIDS.'
							if aidsEffect == 1 then
								proposalMessage = hurtMessage
								acceptMessage = partnerMessage
								hurtPlayer = sexProposal
							elseif aidsEffect == 2 then
								proposalMessage = partnerMessage
								acceptMessage = hurtMessage
								hurtPlayer = sexAccept
							else
								proposalMessage = bothMessage
								acceptMessage = bothMessage
								hurtPlayer = FALSE
							end
							doPlayerSendTextMessage(sexProposal, MESSAGE_INFO_DESCR, proposalMessage)
							doPlayerSendTextMessage(sexAccept, MESSAGE_INFO_DESCR, acceptMessage)
							if hurtPlayer == FALSE then
								doSendMagicEffect(getPlayerPosition(sexProposal),CONST_ME_YELLOW_RINGS)
								doCombat(0,combat,numberToVariant(sexProposal))
								doSendMagicEffect(getPlayerPosition(sexAccept),CONST_ME_YELLOW_RINGS)
								doCombat(0,combat,numberToVariant(sexAccept))
							else
								doSendMagicEffect(getPlayerPosition(hurtPlayer),CONST_ME_YELLOW_RINGS)
								doCombat(0,combat,numberToVariant(hurtPlayer))
							end
						elseif noCondom == 2 then
						payMessage = '\n^.^'
							if getPlayerSex(sexProposal) == 0 then
								childMother = sexProposal
								childFather = sexAccept
								motherMsg = payMessage
								fatherMsg = ""
							elseif getPlayerSex(sexProposal) == 1 then
								childMother = sexAccept
								childFather = sexProposal
								motherMsg = ""
								fatherMsg = payMessage
							else
								if getPlayerSex(sexAccept) == 0 then
									childMother = sexAccept
									childFather = sexProposal
									motherMsg = ""
									fatherMsg = payMessage
								else
									childMother = sexProposal
									childFather = sexAccept
									motherMsg = payMessage
									fatherMsg = ""
								end
							end
							doPlayerSendTextMessage(childFather, MESSAGE_INFO_DESCR, 'Congratulations, '..getCreatureName(childMother)..' had a child!' .. fatherMsg)
							doPlayerSendTextMessage(childMother, MESSAGE_INFO_DESCR, 'Congratulations, you had a child!' .. motherMsg)
							doSendMagicEffect(getPlayerPosition(childFather), CONST_ME_FIREWORK_YELLOW)
							doSendMagicEffect(getPlayerPosition(childMother), CONST_ME_FIREWORK_RED)
							if math.random(2) == 1 then
								childGender = "son"
								childGenderid = "6579"
							else
								childGender = "daughter"
								childGenderid = "9693"
							end
							doSetItemSpecialDescription(doPlayerAddItem(childMother,childGenderid,1),'It is a '..childGender..' of '..getCreatureName(childFather)..' and '..getCreatureName(childMother)..'.')
							local gps = getPlayerItemCount(sexProposal, ITEM_GOLD)
							local pcs = getPlayerItemCount(sexProposal, ITEM_PLATINUM)
							local ccs = getPlayerItemCount(sexProposal, ITEM_CRYSTAL)
							if gps > 0 or pcs > 0 or ccs > 0 then
								doPlayerRemoveItem(sexProposal, ITEM_GOLD, gps)
								doPlayerRemoveItem(sexProposal, ITEM_PLATINUM, pcs)
								doPlayerRemoveItem(sexProposal, ITEM_CRYSTAL, ccs)
							end
						else
doCreatureSay(cid, 'Ahh, Ahh...', TALKTYPE_ORANGE_1)
							doSendMagicEffect(getPlayerPosition(sexProposal),CONST_ME_STUN)
doCreatureSay(cid, 'Ohh, Ohh!', TALKTYPE_ORANGE_1)
							doSendMagicEffect(getPlayerPosition(sexAccept),CONST_ME_STUN)
						end
					end
					setPlayerStorageValue(sexProposal, 66600, 0)
					setPlayerStorageValue(sexAccept, 66600, 0)
				else
					if getPlayerStorageValue(target.uid, 66600) == cid then
						doPlayerSendCancel(cid, 'You have already sent a sex proposal to '..getCreatureName(target.uid)..'.')
						doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
					else
						setPlayerStorageValue(target.uid, 66600, cid)
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have sent a sex proposal to '..getCreatureName(target.uid)..'.')
						doPlayerSendTextMessage(target.uid, MESSAGE_INFO_DESCR, getCreatureName(cid)..' wants to have sex with You.')
						doSendMagicEffect(getPlayerPosition(target.uid),CONST_ME_HEARTS)
					end
				end
			end
		else
			doPlayerSendCancel(cid, 'You must stand infront of your partner to have sex.')
			doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid, 'You can only have sex with players.')
		doSendMagicEffect(getPlayerPosition(cid),CONST_ME_POFF)
	end
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, words)
	return TRUE
end

This script is Old tho, if you can make it to do anal way too thanks lol
 
You can add it in the text of doSetItemSpecialDescription.


Tried to add it, any clue how i can add this to that? loll

Code:
doSetItemSpecialDescription(doPlayerAddItem(childMother,childGenderid,1),'It is a '..childGender..' of '..getCreatureName(childFather)..' and '..getCreatureName(childMother)..'.')

ADD TO IT

Code:
doItemSetAttribute(item, "description", "Baby was born on "..os.date("%A %B %d %X %Y", os.time())..".")
 
You don't have to mix the functions, the text I used, just add that in the text part in doSetItemSpecialDescription.
Also as you can see I used " and the line from your script uses ', so change everything to " or '.
 
You don't have to mix the functions, the text I used, just add that in the text part in doSetItemSpecialDescription.
Also as you can see I used " and the line from your script uses ', so change everything to " or '.

So like this ?

Code:
doSetItemSpecialDescription(doPlayerAddItem(childMother,childGenderid,1),'It is a '..childGender..' of '..getCreatureName(childFather)..' and '..getCreatureName(childMother)..' and '..(item, 'description' of 'Baby was born on '..os.date('%A %B %d %X %Y', os.time())..'.' )
 
No, item and 'description' is for the doItemSetAttribute function, just only use the text (starts with Baby).
Also maybe something useful to understand.
A textmessage is between "" or ''. If you use something in your textmessage that means something, you need to use ".. .."/'.. ..', as you can see at childGender for example.
Using '..childGender..' means it doesn't add it literally to the textmessage but gets the meaning of it. So each time you add something that means anything, then it has to be with "..something.."/'..something..'.
 
Show what you did.

Lol , thats the last i tried,
doSetItemSpecialDescription(doPlayerAddItem(childMother,childGenderid,1),'It is a '..childGender..' of '..getCreatureName(childFather)..' and '..getCreatureName(childMother)..' item '..description..' of '..Baby was born on '..os.date('%A %B %d %X %Y', os.time())..'.' )



I seriously dont understand a piece of that , just wanted to add the date on that :|
 
LUA:
doSetItemSpecialDescription(doPlayerAddItem(childMother,childGenderid,1),'It is a '..childGender..' of '..getCreatureName(childFather)..' and '..getCreatureName(childMother)..'. Baby was born on '..os.date('%A %B %d %X %Y', os.time())..'.')
 
Back
Top