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

Talkaction Script error

Onizuka

Member
Joined
Jul 5, 2008
Messages
2,291
Reaction score
14
Script was from 8.5 tibia, but i'd thought it would work on 3.6.pl1, Guess not.

Code:
[Error - LuaScriptInterface::loadFile] Data/talkactions/scripts/crazy.lua::7 '>' expected <to close '<' at line 6> near 'doCreatureSetSkullType'
[Warning - Event::loadScript] Cannot load script <data/talkactions/scripts/crazy.lua>


Lua:
function changeSkull(cid)
local position = getCreaturePosition(cid)
        if (not isPlayer(cid)) then
                return true
        end
        if (getCreatu
                doCreatureSetSkullType(cid, 1)
        end
        = getCreaturePosition(cid)
local outfit = {
lookType = math.random(137,160),
lookHead = math.random(1,130),
lookBody = matraom(1,130),
lookFdom(1,130),
lookAddons = 3
}   
      doSendDistanceShoot(getCreaturePosition(cid), {x = position.x + math.random(-7, 7), y = position.y + math.random(-5, 5), z = position.z}, math.random(1,41)) 
        doSendMagicEffect({x = position.x + math.random(-7, 7), y = position.y + math.random(-5, 5), z = position.z}, math.random(1,32))
          doCreatureChangeOutfit(cid, outfit)
           doCreatureSetLookDirection(cid, math.random(1,8))
            doCreatureSetSpeakType(cid, 19)
             doSetCreatureLight(cid, math.random(1,200), math.random(1,10), 1000)
      addEvent(crazy, 200, cid)
        return true
end
function onSay(cid, words, param, channel)
local time = 1
local storage = 100
local outfit = {
lookType = 128,
lookHead = math.random(1,130),
lookBody = math.random(1,130),
lookLegs = math.random(1,130),
lookFeet = math.random(1,130),
lookAddons = 0
} 
   if param == "on" and getPlayerStorageValue(cid, storage) == -1 then 
        doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Its Crazy Time.")
          addEvent(changeSkull, time * 200, cid)
            addEvent(crazy, time * 200, cid)
             setPlayerStorageValue(cid, storage, 1)   
        elseif param == "off" then
         doCreatureChangeOutfit(cid, outfit)
             setPlayerStorageValue(cid, storage, -1)
           addEvent(doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"GoodBye"), 4000, cid) 
          addEvent(doRemoveCreature, time * 2000, cid) 
        end     
        return true
end


Thanks...

Regards.


@ i think the error is here, missing code part.

Lua:
if (getCreatu
                doCreatureSetSkullType(cid, 1)
 
Code:
function changeSkull(cid)
	local position = getCreaturePosition(cid)
	if not isPlayer(cid) then
		return true
	end
	doCreatureSetSkullType(cid, getCreatureSkullType(cid) < 4 and getCreatureSkullType(cid) + 1 or 1)
	addEvent(changeSkull, 200, cid)
end

function crazy(cid)
	local position, outfit = getCreaturePosition(cid), {lookType = math.random(137,160), lookHead = math.random(130), lookBody = math.random(130), lookLegs = math.random(130), lookFeet = math.random(130), lookAddons = 3}
	doSendDistanceShoot(getCreaturePosition(cid), {x = position.x + math.random(-7, 7), y = position.y + math.random(-5, 5), z = position.z}, math.random(41))
	doSendMagicEffect({x = position.x + math.random(-7, 7), y = position.y + math.random(-5, 5), z = position.z}, math.random(32))
	doCreatureChangeOutfit(cid, outfit)
	doCreatureSetLookDirection(cid, math.random(8))
	doCreatureSetSpeakType(cid, 19)
	doSetCreatureLight(cid, math.random(200), math.random(10), 1000)
	addEvent(crazy, 200, cid)
end

function onSay(cid, words, param, channel)
	local time, storage, outfit = 1, 100, {lookType = 128, lookHead = math.random(130), lookBody = math.random(130), lookLegs = math.random(130), lookFeet = math.random(130), lookAddons = 0}
	if param == "on" and getPlayerStorageValue(cid, storage) < 1 then
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Its Crazy Time.")
		addEvent(changeSkull, time * 200, cid)
		addEvent(crazy, time * 200, cid)
		setPlayerStorageValue(cid, storage, 1)
	elseif param == "off" then
		doCreatureChangeOutfit(cid, outfit)
		setPlayerStorageValue(cid, storage, -1)
		addEvent(doPlayerSendTextMessage, 4000, cid, MESSAGE_INFO_DESCR, "GoodBye")
		addEvent(doRemoveCreature, time * 2000, cid)
	end
	return true
end
Google<3 (it only did the part of work)
 
Back
Top