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

Lua Skull remover, Stamina item/cake for tfs 0.2.15

furmanss

New Member
Joined
May 14, 2013
Messages
125
Reaction score
0
i i need these 2 scripts, skull remover Example red skull/black skull and an stamina item/cake that gives u full stamina on use tho ive searched but cant find for 0.2.15 please help

- - - Updated - - -

i have this now but i get error
Lua:
function onUse(cid, item, frompos, item2, topos)
 
	if math.random(100) < 15 then
		doPlayerRemoveItem(cid, 9969, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Unfortunately, the skull remover broke!")
		return false
	end
 
        local noRemove = {SKULL_WHITE, SKULL_YELLOW}
        local playerSkull = getPlayerSkullType(cid)
        if isInArray(noRemove, playerSkull) then
        	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not remove this type of skull.")
        	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        	return true
	end
 
        if playerSkull == SKULL_NONE then 
            	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have any skull!")
            	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            	return true
	end
 
	if playerSkull == SKULL_RED or playerSkull == SKULL_BLACK then
                db.query("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
            	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags and skull have been succesfully removed!")
            	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
            	doCreatureSetSkullType(cid,0)
            	doPlayerSetSkullEnd(cid, 0, playerSkull)
            	doPlayerRemoveItem(cid, 9969, 1)
        end
        return true
end
Lua:
[14/06/2013 21:59:21] mysql_real_query(): UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = 184): MYSQL ERROR: Table 'otserv.killers' doesn't exist

[14/06/2013 21:59:21] Lua Script Error: [Action Interface] 
[14/06/2013 21:59:21] data/actions/scripts/other/skull remover.lua:onUse
[14/06/2013 21:59:21] data/actions/scripts/other/skull remover.lua:27: attempt to call global 'doCreatureSetSkullType' (a nil value)
[14/06/2013 21:59:21] stack traceback:
[14/06/2013 21:59:21] 	[C]: in function 'doCreatureSetSkullType'
[14/06/2013 21:59:21] 	data/actions/scripts/other/skull remover.lua:27: in function <data/actions/scripts/other/skull remover.lua:1>

- - - Updated - - -

please help i need these scripts ;(
 
Lua:
function onUse(cid, item, frompos, item2, topos)
 
	if math.random(100) < 15 then
		doPlayerRemoveItem(cid, 9969, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Unfortunately, the skull remover broke!")
		return false
	end
 
        local noRemove = {SKULL_WHITE, SKULL_YELLOW}
        local playerSkull = getPlayerSkullType(cid)
        if isInArray(noRemove, playerSkull) then
        	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not remove this type of skull.")
        	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        	return true
	end
 
        if playerSkull == SKULL_NONE then 
            	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have any skull!")
            	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            	return true
	end
 
	if playerSkull == SKULL_RED or SKULL_BLACK then
                db.query("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
            	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags and skull have been succesfully removed!")
            	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
           	doCreatureSetSkullType(cid, SKULL_NONE)
            	doPlayerSetSkullEnd(cid, 0, playerSkull)
            	doPlayerRemoveItem(cid, 9969, 1)
        end
        return true
end

This Should work.if i didn't i will give you another one

- - - Updated - - -
Cake(for full hp and mana) not tested but i think it will work

Lua:
function onUse(cid, item, frompos, item2, topos)
                    if item.itemid == XXX then
                      doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
					  doCreatureAddMana(cid, getCreatureMaxMana(cid))
                      doPlayerSendTextMessage(cid, 14, Done(mana,Hp))
                   end
                 return TRUE
  end

PS: Don't Forget to change the item.itemid in Script to the itemid of cake
 
Last edited:
error
Lua:
[15/06/2013 02:06:46] mysql_real_query(): UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = 184): MYSQL ERROR: Table 'otserv.killers' doesn't exist

[15/06/2013 02:06:46] Lua Script Error: [Action Interface] 
[15/06/2013 02:06:46] data/actions/scripts/other/skull remover.lua:onUse
[15/06/2013 02:06:46] data/actions/scripts/other/skull remover.lua:27: attempt to call global 'doCreatureSetSkullType' (a nil value)
[15/06/2013 02:06:46] stack traceback:
[15/06/2013 02:06:46] 	[C]: in function 'doCreatureSetSkullType'
[15/06/2013 02:06:46] 	data/actions/scripts/other/skull remover.lua:27: in function <data/actions/scripts/other/skull remover.lua:1>
same as before i think and i ment stamina cake btw ;) not full hp mana ^^
 
Lua:
function onUse(cid, item, frompos, item2, topos)
                    local time = 60---in minute
                    if item.itemid == XXX then
	             doPlayerAddStamina(cid, time)
                      doPlayerSendTextMessage(cid, 14, you got More Stamina)
                   end
                 return TRUE
  end

- - - Updated - - -

for the skll remover.you can try another distro.yours doesn't have the doCreatureSetSkullType
 
redSkull
Lua:
function onUse(cid, item, frompos, item2, topos)
 
	if math.random(100) < 15 then
		doPlayerRemoveItem(cid, 9969, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Unfortunately, the skull remover broke!")
		return false
	end
 
        local noRemove = {SKULL_WHITE, SKULL_YELLOW}
        local playerSkull = getPlayerSkullType(cid)
         if isInArray(noRemove, getPlayerSkullType(cid)) then
        	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not remove this type of skull.")
        	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        	return true
	end
 
        if playerSkull == SKULL_NONE then 
            	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have any skull!")
            	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            	return true
	end
 
	if playerSkull == SKULL_RED or playerSkull == SKULL_BLACK then
                db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
            	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags and skull have been succesfully removed!")
            	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
            	doCreatureSetSkullType(cid,0)
            	doPlayerSetSkullEnd(cid, 0, playerSkull)
            	doPlayerRemoveItem(cid, 9969, 1)
        end
        return true
end

stamina
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {}
	cfg.refuel = 42 * 60 * 1000
	if(getPlayerStamina(cid) >= cfg.refuel) then
		doPlayerSendCancel(cid, "Your stamina is already full.")
	elseif(not isPremium(cid)) then
		doPlayerSendCancel(cid, "You must have a premium account.")
	else
		doPlayerSetStamina(cid, cfg.refuel)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
		doRemoveItem(item.uid)
	end
	return true
end
 
didnt work , Stamina Cake
Lua:
[17/06/2013 17:42:24] Lua Script Error: [Action Interface] 
[17/06/2013 17:42:24] data/actions/scripts/other/stamina cake.lua:onUse
[17/06/2013 17:42:24] data/actions/scripts/other/stamina cake.lua:4: attempt to call global 'getPlayerStamina' (a nil value)
[17/06/2013 17:42:24] stack traceback:
[17/06/2013 17:42:24] 	[C]: in function 'getPlayerStamina'
[17/06/2013 17:42:24] 	data/actions/scripts/other/stamina cake.lua:4: in function <data/actions/scripts/other/stamina cake.lua:1>
Skull remover
Lua:
[17/06/2013 17:57:17] mysql_real_query(): UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = 213): MYSQL ERROR: Table 'otserv.killers' doesn't exist

[17/06/2013 17:57:17] Lua Script Error: [Action Interface] 
[17/06/2013 17:57:17] data/actions/scripts/other/skull remover.lua:onUse
[17/06/2013 17:57:17] data/actions/scripts/other/skull remover.lua:27: attempt to call global 'doCreatureSetSkullType' (a nil value)
[17/06/2013 17:57:17] stack traceback:
[17/06/2013 17:57:17] 	[C]: in function 'doCreatureSetSkullType'
[17/06/2013 17:57:17] 	data/actions/scripts/other/skull remover.lua:27: in function <data/actions/scripts/other/skull remover.lua:1>

- - - Updated - - -

getplayerstamina doesnt work, and the "killers" thingy on phpmyadmin doesnt exist maybe cus im using 0.2.15 but please guys can u help me fix this ? :(
 
Back
Top