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

CreatureScript - onKill

Xyzyk

RudziutOTS Maker
Joined
Jun 14, 2008
Messages
39
Reaction score
0
Location
Poland
Hello, I have problem with my script:
function onKill(cid, target, lastHit)
if getCreatureName(target):lower() == 'The Horned Fox' then
setGlobalStorageValue(11011, -1)
doCreatureSay(cid, "If you see this message, then this script work.")
if getPlayerStorageValue(cid,11041) == -1 then
setPlayerStorageValue(cid,11041,1)
end
end
return true
end

If I kill 'The Horned Fox' this script doesn't work.:huh: Please help.
 
Tried cykko style
LUA:
function onKill(cid, target, lastHit)
	if (getCreatureName(target):lower() == "the horned fox") and doCreatureSay(cid, "You killed the horned fox, script works!", TALKTYPE_ORANGE_1) and getCreatureStorageValue(cid, 11041) < 1 and setPlayerStorageValue(cid, 11041, 1) then
	end
		return true
end
 
Code:
function onKill(cid, target, lastHit)
	if lastHit and getCreatureName(target):lower() == 'the horned fox' then
		setGlobalStorageValue(11011, -1)
		doCreatureSay(cid, "If you see this message, then this script work.", TALKTYPE_ORANGE_1)
		if getPlayerStorageValue(cid, 11041) < 1 then
			setPlayerStorageValue(cid, 11041, 1)
		end
	end
	return true
end
#zonet, don't because you're doing it wrong
 
Code:
function onKill(cid, target, lastHit)
	if lastHit and getCreatureName(target):lower() == 'the horned fox' then
		setGlobalStorageValue(11011, -1)
		doCreatureSay(cid, "If you see this message, then this script work.", TALKTYPE_ORANGE_1)
		if getPlayerStorageValue(cid, 11041) < 1 then
			setPlayerStorageValue(cid, 11041, 1)
		end
	end
	return true
end
#zonet, don't because you're doing it wrong

:$, how would it be then?
 
Back
Top