• 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!

Broadcast after switch

moshon

New Member
Joined
Dec 23, 2008
Messages
17
Reaction score
1
I made script for my new event but he doesnt work :/
This script is a system when i put 3 items on position i put they making Broadcast msg
And i need your help to make it work






Code:
function onUse(cid, item, frompos, item2, topos)
	-- Item ID and Uniqueid --
	switchUniqueID = 6000
	switchID = 1945
	switch2ID = 1946
	swordID	= 5910
	crossbowID = 5910
	appleID	= 5910
 
 
 
 
	piece1pos = {x=937, y=1228, z=7, stackpos=1} -- Where the first piece will be 

placed
	getpiece1 = getThingfromPos(piece1pos)
 
	piece2pos = {x=937, y=1229, z=7, z=8, stackpos=1} -- Where the second piece will be 

placed
	getpiece2 = getThingfromPos(piece2pos)
 
	piece3pos = {x=937, y=1230, z=7, stackpos=1} -- Where the third piece will be 

placed
	getpiece3 = getThingfromPos(piece3pos)
 


			if item.uid == switchUniqueID and item.itemid == switchID and 

getpiece1.itemid == swordID and getpiece2.itemid == crossbowID and getpiece3.itemid == 

appleID then

doBroadcastMessage("Information: "Red Team Has Won the Event"", 

MESSAGE_STATUS_CONSOLE_ORANGE)
return TRUE


 
				doTransformItem(item.uid,item.itemid+1)
			elseif item.uid == switchUniqueID and item.itemid == switch2ID then
				doTransformItem(item.uid,item.itemid-1)
			else
				doPlayerSendCancel(cid,"Sorry, you need to put the correct 

stuffs at the correct basins.")
			end
			else
			return 0
			end
end
 
Last edited by a moderator:
try
PHP:
function onUse(cid, item, frompos, item2, topos)
-- Item ID and Uniqueid --
switchUniqueID = 6000
switchID = 1945
switch2ID = 1946
swordID = 5910
crossbowID = 5910
appleID = 5910

piece1pos = {x=937, y=1228, z=7, stackpos=1} -- Where the first piece will be
getpiece1 = getThingfromPos(piece1pos)

piece2pos = {x=937, y=1229, z=7, z=8, stackpos=1} -- Where the second piece will be
getpiece2 = getThingfromPos(piece2pos)

piece3pos = {x=937, y=1230, z=7, stackpos=1} -- Where the third piece will be
getpiece3 = getThingfromPos(piece3pos)

if item.uid == switchUniqueID and item.itemid == switchID and getpiece1.itemid == swordID and getpiece2.itemid == crossbowID and getpiece3.itemid == appleID then

	doBroadcastMessage("Information: Red Team Has Won the Event", MESSAGE_STATUS_CONSOLE_ORANGE)
	doTransformItem(item.uid,item.itemid+1)
elseif item.uid == switchUniqueID and item.itemid == switch2ID then
	doTransformItem(item.uid,item.itemid-1)
else
	doPlayerSendCancel(cid,"Sorry, you need to put the correct stuffs at the correct basins.")
		end
	return TRUE
end
 
Back
Top