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

onKill

donacool

Mapper Scripter Ot Owner
Joined
Jan 15, 2010
Messages
97
Reaction score
0
i need a script that if:
someone that haves a storage value of 1 and gets killed by someone that haves a storage value of 2 its says with animated text "Blue Kill!" in color blue.
but if:
someone that haves a storage value of 2 and gets killed bye
someone that haves a storage value of 1 its says with anikmated text "Red Kill!" in color red.
and in each kill only the one that do the last hit it gains a reward of 50 gp.
 
Code:
function onKill(cid, target, lastHit)
local s = 15023
	if getPlayerStorageValue(cid,s) == 1 then
		doCreatureSay(cid,'BLUE KILL!',27)
	else
		doCreatureSay(cid,'RED KILL!',MESSAGE_STATUS_CONSOLE_RED)
	end
	return true
end

if it doesn't work change the '27' and 'MESSAGE_STATUS_CONSOLE_RED' to 19.

And please don't bump within 24 hours.
 
ey unk, wat is that man ;s
Lua:
local s, item = 15023, 1932 --STORAGE / REWARD ITEMID

function onKill(cid, target, lastHit)
    if not isPlayer(cid) or not isPlayer(target) then
        return true
    end
    
    if getCreatureStorage(cid, s) == 2 and getCreatureStorage(cid, target) == 1 then
        doSendAnimatedText(getThingPos(target),TEXTCOLOR_LIGHTBLUE,'BLUE KILL!')
        if lastHit then
            doPlayerAddItem(cid, item, 1)
        end
    elseif getCreatureStorage(cid, s) == 1 then
        doSendAnimatedText(getThingPos(target),TEXTCOLOR_RED,'RED KILL!')
        if lastHit then
            doPlayerAddItem(cid, item, 1)
        end
    end
    return true
end
 
lol it has bugg so if they kill someone they will recieve too the red kill even if its not war time
 
well thats for my capture the flag event so if i want them that he blue team have id 2 and red team 1 i need to put this but in another script?
setPlayerStorageValue(cid, 1)
setPlayerStorageValue(cid, 2)
?????

and how do i make that if a blue teamer cant atack a blue teamer and that a red teamer cant atack a red teamer
 
Code:
setPlayerStorageValue(cid,[B]storage[/B],1)
setPlayerStorageValue(cid,[B]storage[/B],2)

Yes, you should do that.

##
in config.lua change

Code:
noDamageToSameLookfeet = [COLOR="Blue"]false[/COLOR]

to

Code:
noDamageToSameLookfeet = [COLOR="Blue"]true[/COLOR]
 
i made it but it tells me '=' expected near else
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local redPos = {x = 63108, y = 61333, z = 7}
local bluePos = {x = 63109, y = 61333, z = 7}
local tileid = 3177
local uniqueid = 1000
local red = setPlayerStorageValue(cid, storage, 1)
local blue = setPlayerStorageValaue(cid, storage, 2)
	if isPlayer(cid) and item.itemid == tileid and item.uid == uniqueid then
		if math.random(1, 2) == 1 then
			doTeleportThing(cid, redPos)
			red
		else
			doTeleportThing(cid, bluePos)
			blue
		end return true
	end return true
end return true

###
lol i just changed it for this:
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local redPos = {x = 63108, y = 61333, z = 7}
local bluePos = {x = 63109, y = 61333, z = 7}
local tileid = 3177
local uniqueid = 1000
	if isPlayer(cid) and item.itemid == tileid and item.uid == uniqueid then
		if math.random(1, 2) == 1 then
			doTeleportThing(cid, redPos)
			setPlayerStorageValue(cid, storage, 1)
		else
			doTeleportThing(cid, bluePos)
			setPlayerStorageValaue(cid, storage, 2)
		end return true
	end return true
end return true
 
i got a bug when i get teleportedit says in black color 100
but when i try again it says:
[Error - MoveEvents Interface]
[02/08/2010 12:12:01] data/movements/scripts/ctfwteleport.lua:eek:nStepIn
[02/08/2010 12:12:01] Description:
[02/08/2010 12:12:01] data/movements/scripts/ctfwteleport.lua:13: attempt to call global 'doPlayerSetStorageValaue' (a nil value)
[02/08/2010 12:12:01] stack traceback:
[02/08/2010 12:12:01] data/movements/scripts/ctfwteleport.lua:13: in function <data/movements/scripts/ctfwteleport.lua:1>

the script is:
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local redPos = {x = 63108, y = 61333, z = 7}
local bluePos = {x = 63109, y = 61333, z = 7}
local tileid = 3177
local uniqueid = 1000
	if isPlayer(cid) and item.itemid == tileid and item.uid == uniqueid then
		if math.random(1, 2) == 1 then
			doTeleportThing(cid, redPos)
			doPlayerSetStorageValue(cid, storage, 1)
			doSendAnimatedText(getCreaturePosition(cid), TEXTCOLOR_RED, "RED!")
		else
			doTeleportThing(cid, bluePos)
			doPlayerSetStorageValaue(cid, storage, 2)
			doSendAnimatedText(getCreaturePosition(cid), TEXTCOLOR_LIGHTBLUE, "Blue!")
		end return true
	end return true
end return true
 
well you don't have to redeclare the uid and tile itemid you know..
Lua:
local redPos = {x = 63108, y = 61333, z = 7}
local bluePos = {x = 63109, y = 61333, z = 7}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if isPlayer(cid) then
        if math.random(2) == 1 then
            doTeleportThing(cid, redPos)
            doCreatureSetStorage(cid, storage, 1)
            doSendAnimatedText(getCreaturePosition(cid), TEXTCOLOR_RED, 'Red!')
        else
            doTeleportThing(cid, bluePos)
            doCreatureSetStorage(cid, storage, 2)
            doSendAnimatedText(getCreaturePosition(cid), TEXTCOLOR_LIGHTBLUE, 'Blue!')
        end 
    end 
    return true
end

 
Back
Top