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

Creaturescript request Monster attack you and add skull

try this:
LUA:
local monster = "monster name"
function onCombat(cid, target)
	if isMonster(target) and isPlayer(cid) and getCreatureName(target) == string.lower(monster)  then
		doCreatureSetSkullType(cid, math.random(1,6))
	end
    return true
end
 
If he wants it so the monster attacks the player to give a player a skull, you can't do the script that way. In onCombat, cid = the attacker, and target = the one being attacked. So you would need to make the player(target) and the monster(cid) and use isCreature instead of isMonster
 
LUA:
local name = "dog"
function onCombat(cid, target)
	if isPlayer(target) and isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(name) then
		doCreatureSetSkullType(target, math.random(1, 6))
	end
    return true
end

And you need to register it on monster... Then, it should work...
 
Last edited:
Back
Top