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

Help with disco squares please

Xaiman

New Member
Joined
Feb 27, 2010
Messages
94
Reaction score
0
I never script so i really dont know what im doing but this is what i have.. yet i cant get it to work.

Code:
local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 10 * 1000)
setConditionParam(drunk, CONDITION_PARAM_BUFF, TRUE)

function onStepIn(cid, item, position, fromPosition, item2)
	local p = {cid = cid, position = position}
	local position = getCreaturePosition(cid)
	position.stackpos = 255
	if(item.actionid == 904) then
		local lightLevel = math.random(1, 10) 
		local lightTicks = 1 
		local lighttextRND = math.random(1, 254)
		local rand = math.random(1, 9)
			if rand == 1 then
				doSetCreatureLight(cid, lightLevel, 78, lightTicks)
			return doAddCondition(cid, drunk)
			elseif rand == 2 then
				doSetCreatureLight(cid, lightLevel, 147, lightTicks)
			return TRUE
			elseif rand == 3 then
				doSetCreatureLight(cid, lightLevel, 203, lightTicks)
			return TRUE
			elseif rand == 4 then
				doSetCreatureLight(cid, lightLevel, 180, lightTicks)
			return TRUE
			elseif rand == 5 then
				doSetCreatureLight(cid, lightLevel, 5, lightTicks)
			return TRUE
			elseif rand == 6 then
				doSetCreatureLight(cid, lightLevel, 6, lightTicks)
			return TRUE
			elseif rand == 7 then
				doSetCreatureLight(cid, lightLevel, 174, lightTicks)
			return TRUE
			elseif rand == 8 then
				doSetCreatureLight(cid, lightLevel, 1, lightTicks)
			return TRUE
			elseif rand == 9 then
				doSetCreatureLight(cid, lightLevel, 1, lightTicks)
			return TRUE
			end
		return 1		
	end
end

and the xml...

Code:
<movevent event="StepIn" actionid="904" script="discosquare.lua"/>
 
no errors that i found. i can do /reload movements and it comes up wiith no errors. it just doesnt do anything when the sqm is stepped in
 
Back
Top