• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Can some one make me a script?

zedo99

New Member
Joined
Jun 26, 2009
Messages
34
Reaction score
0
Location
Cincinnati, OH
I need a script for

When you use a sign it makes you eat food (same as dragon ham)?

I want it for my training area

Thanks!
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local feed_powah = 400
	doPlayerFeed(cid, feed_powah)
	return TRUE
end
 
You can also add
doCreatureSay(cid, "Chomp", TALKTYPE_ORANGE_1)
it will look sth like that

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local feed_powah = 400
        doCreatureSay(cid, "Chomp", TALKTYPE_ORANGE_1)
	doPlayerFeed(cid, feed_powah)
	return TRUE
end

But I think its unnecessary, only makes script work that it looks like you ate(?) a ham or drag ham
 
Now

Okay signs work now, you can eat off of them. but there is no limit like a dragon ham. you can use sign as many times are you want and you keep eating. How do i fix this?
 
Last edited:
Set action xxxx to sign and add this line in actions.xml

<action actionid="xxxx" event="script" value="script_name.lua"/>

:eek::huh::p<_<;)^_^:D:thumbup::wub::blink::w00t::cool::rolleyes::(:):huh::mad::confused::eek::p;)^_^<_<
 
Okay signs work now, you can eat off of them. but there is no limit like a dragon ham. you can use sign as many times are you want and you keep eating. How do i fix this?

Youll have to add a check at the beggining of the script:
Code:
if getPlayerFood(cid) < 720 then -- This is the dragon hams power I suppose
    --your script
    return TRUE
end
 
Why not integrate it into your food.lua?

data/actions/scripts/other/food.lua
Code:
local food =
{
	[2362] = {8, "Crunch."},
	[2666] = {15, "Munch."},
	[2667] = {12, "Munch."},
	[2668] = {10, "Mmmm."},
	[2669] = {17, "Munch."},
	[2670] = {4, "Gulp."},
	[2671] = {30, "Chomp."},
	[2672] = {60, "Chomp."},
	[2673] = {5, "Yum."},
	[2674] = {6, "Yum."},
	[2675] = {13, "Yum."},
	[2676] = {8, "Yum."},
	[2677] = {1, "Yum."},
	[2678] = {18, "Slurp."},
	[2679] = {1, "Yum."},
	[2680] = {2, "Yum."},
	[2681] = {9, "Yum."},
	[2682] = {20, "Yum."},
	[2683] = {17, "Munch."},
	[2684] = {8, "Crunch."},
	[2685] = {6, "Munch."},
	[2686] = {9, "Crunch."},
	[2687] = {2, "Crunch."},
	[2688] = {9, "Munch."},
	[2689] = {10, "Crunch."},
	[2690] = {3, "Crunch."},
	[2691] = {8, "Crunch."},
	[2792] = {6, "Munch."},
	[2793] = {9, "Munch."},
	[2695] = {6, "Gulp."},
	[2696] = {9, "Smack."},
	[2787] = {9, "Munch."},
	[2788] = {4, "Munch."},
	[2789] = {22, "Munch."},
	[2790] = {30, "Munch."},
	[2791] = {30, "Munch."},
	[2792] = {6, "Munch."},
	[2794] = {3, "Munch."},
	[2795] = {36, "Munch."},
	[2796] = {5, "Munch."},
	[2793] = {9, "Munch."},
	[5097] = {4, "Yum."},
	[6125] = {8, "Gulp."},
	[6278] = {10, "Mmmm."},
	[6279] = {15, "Mmmm."},
	[6393] = {12, "Mmmm."},
	[6394] = {15, "Mmmm."},
	[6501] = {20, "Mmmm."},
	[6541] = {6, "Gulp."},
	[6542] = {6, "Gulp."},
	[6543] = {6, "Gulp."},
	[6544] = {6, "Gulp."},
	[6545] = {6, "Gulp."},
	[6569] = {1, "Mmmm."},
	[6574] = {4, "Mmmm."},
	[7158] = {15, "Munch."},
	[7159] = {13, "Munch."},
	[7372] = {7, "Yum."},
	[7373] = {7, "Yum."},
	[7374] = {7, "Yum."},
	[7375] = {7, "Yum."},
	[7376] = {7, "Yum."},
	[7377] = {7, "Yum."},
	[7963] = {60, "Munch."},
	[8838] = {10, "Gulp."},
	[8839] = {5, "Yum."},
	[8840] = {1, "Yum."},
	[8841] = {1, "Urgh."},
	[8842] = {7, "Munch."},
	[8843] = {5, "Crunch."},
	[8844] = {1, "Gulp."},
	[8845] = {5, "Munch."},
	[8847] = {11, "Yum."},
	[9005] = {7, "Slurp."},
	[B][COLOR="Red"][ID_OF_SIGN] = {FEED_PERCENT, "Chomp."}[/COLOR][/B]
}
function onUse (cid, item, fromPosition, itemEx, toPosition)
	if(not food[item.itemid]) then
		return FALSE
	end

	if(getPlayerFood(cid) + food[item.itemid][1]) >= 400 then
		doPlayerSendCancel(cid, "You are full.")
	else
		doPlayerFeed(cid, food[item.itemid][1] * 4)
		doCreatureSay(cid, food[item.itemid][2], TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	end

	return TRUE
end

data/actions/actions.xml
Code:
	<action itemid="[B][COLOR="Red"]ID_OF_SIGN[/COLOR][/B]" event="script" value="other/food.lua"/>
 
hope Cykotitan did help you bec he helps like all pepol (did giv u 1 more rep) :p
 
Back
Top Bottom