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

Solved on kill

UpInSmoke

Supreme Ruler
Joined
Nov 16, 2008
Messages
303
Reaction score
21
so im working on a system where you get points for killing players:
Code:
local storage = 28100
function onKill(cid, target, lastHit)
	if lastHit == true then
		if(isPlayer(target) == TRUE) then
			if getPlayerIp(cid) == getPlayerIp(target) then		
				if getPlayerStorageValue(cid,storage) > 0 then
				setPlayerStorageValue(cid,storage,(getPlayerStorageValue(cid,storage)-1))
				doPlayerSendTextMessage(cid, 19, "You lose a pk point for killing a player of the same IP.")
				end
			else
			doPlayerSendTextMessage(cid, 19, "You now have: "..getPlayerStorageValue(cid,storage).. " pk points.")
			setPlayerStorageValue(cid,storage,(getPlayerStorageValue(cid,storage)+1))
			end
		end
	end
	return true
end
not getting any errors but it doesnt seem to work, actually just cause it wasnt working i went ahead and tried this:
Code:
function onKill(cid, target, lastHit)
	if isPlayer(target) then 
		doPlayerSendTextMessage(cid, 19, "test")
	end
return true
end
that does work either... any ideas why..?
 
Did you register the name you used in the creaturescripts.xml line in login.lua?
Also, which server do you use and how did you added it in creaturescripts.xml?
 
Last edited:
Did you register the name you used in the creaturescripts.xml line in login.lua?
Also, which server do you use and how did you added it in creaturescripts.xml?

yes in login.lua
Code:
registerCreatureEvent(cid, "pkPoints")
in creaturescripts.xml
Code:
<event type="kill" name="pkPoints" script="pkPoints.lua"/>
im using cryingdamson 0.3.6 (8.60)
 
Back
Top