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

Lua Error in Creaturescript =D?

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
I have this error :/ Anyone can help me?:$

[25/02/2010 04:07:54] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/proteccion.lua)
[25/02/2010 04:07:54] data/creaturescripts/scripts/proteccion.lua:6: ')' expected (to close '(' at line 5) near 'doTeleportThing'


Code:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 40 then
		doCreatureSetDropLoot(cid, 0)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true) 
		doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid))
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) 
	end
return true
end
 
Code:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 40 then
		doCreatureSetDropLoot(cid, 0)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true) 
		doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) 
	end
return true
end

Try this, missing a ) on line 5.
 
Lua:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 40 then
		doCreatureSetDropLoot(cid, 0)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true) 
		doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) 
	end
return true
end
 
Last edited:
Code:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 40 then
		doCreatureSetDropLoot(cid, false)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) 
	end
	return true
end
 
Back
Top