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

Script Problem (Creaturescript) - Should be easy fix

  • Thread starter Thread starter Deleted member 49793
  • Start date Start date
D

Deleted member 49793

Guest
Hey guys like i said this should be a super easy fix but i dunno why its not wroking

So script is suppose to remove a rock when this monster dies then remake the rock after 60 seconds...

Im getting this error:

The creature listed is The Blacksmith, In my monster folder (Monster/Dwarves) Has The Blacksmith however it says no valid creature, can someone explain whats wrong?
Code:
Error - CreatureEvent::configureEvent] No valid type for creature event.onkill
[Warning - BaseEvents::loadFromXml] Cannot configure an event


Code:
local name = "The Blacksmith"
local times = 60   -- in seconds
local stoneid  = 1304  -- put the id of whatever that will be removed
local place = {x=750,y=1067,z=15}   -- put the place of w/e will be removed
function onKill(cid,target,lastHit)
	local function create()
		if getTileItemById(place,stoneid).uid < 1 then
			doCreateItem(stoneid,1,place)
		end
	end
	if lastHit then
		if string.lower(getCreatureName(target)) == string.lower(name) then
			stopEvent(event)
			p = getThisPos(target)
			frompos = {x=p.x-5,y=p.y-5,z=p.z}
			topos = {x=p.x+5,y=p.y+5,z=p.z}
			if getTileItemById(place,stoneid).uid > 0 then
				doRemoveItem(getTileItemById(place,stoneid).uid)
				event = addEvent(create,times*1000)
			end
			for v = frompos.x , topos.x do
				for t = frompos.y , topos.y do
					pos = {x=v,y=t,z=p.z}
					pid = getTopCreature(pos).uid
						if isPlayer(pid) then
							doPlayerSendTextMessage(pid,19,"Stone was removed and will reappear "..times.." seconds.")
						end
				end
			end
		end
	end
	return true
end
 
Back
Top