• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[request] Script - Mushrooms drugs effect

bury

Active Member
Joined
Jul 27, 2008
Messages
421
Solutions
7
Reaction score
25
Thanks to @streamSide and @Defeater I could complete my goal of the weed effect. It works really good.

Now I want this mushroom drug effect and I'll complete my drugs quest xD

As I told I like to have an storage to enable and disable it in custom players etc

The effect is just the player look (only look not move) at random places and say utevo res ina "pig (I tried in the other script puting the spell but it only says it instead of casting it, so it has no effect.

A player with both effects would be awesome ^^

Thanks for your time. :rolleyes::rolleyes::rolleyes:
 
LUA:
local storage = 1234
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureStorage(pid, storage) > 0 then
		doCreatureSay(cid, 'utevo res "Pig', TALKTYPE_ORANGE_1) 
		local pig = doSummonCreature("Pig", getCreaturePosition(cid))
		doConvinceCreature(cid, pig)
		addEvent(shroom, 1000,pid)
	else
		doPlayerSendCancel(cid, "He's on the shroom affect already.")
	end
return true
end

function shroom(cid)
	if getCreatureStorage(cid, storage) > 0 then
			local a,b,c = {EAST,WEST,SOUTH,NORTH}, {"Holy cows, is that a flying pig!?", "Oh DUDE, I think I am seeing my mother in law!", "ITS A GIANT PIG", "A PURPLE PIG WTF"}, 0
			doCreatureSetLookDirection(cid, a[math.random(1,#a)])
			doCreatureSay(cid, b[math.random(1,#b)], TALKTYPE_ORANGE_1)
			if c < 6 then
				c = c+1
				addEvent(shroom,1000,cid)
			else
				doPlayerSendTextMessage(cid, 21, "Was that a fun trip, bro?")
				setPlayerStorageValue(cid,storage,-1)
			end
	end
end
lulz
 
Last edited:
Thanks you @bogart!

Do you know how can I control it with the storage?

It works 100% with the item (registered in actions.xml) I mean it works eating the mushroom but not with the command /storage.

Ex: /storage player, 1234, 1 -> doesnt work

But if I 'use' the item I set in the xml the script works properly and then with the admin with the command

/storage player, 1234, 0 -> It stops working

So why it doesnt work to run in but it works to stop it?
 
Thanks you @bogart!

Do you know how can I control it with the storage?

It works 100% with the item (registered in actions.xml) I mean it works eating the mushroom but not with the command /storage.

Ex: /storage player, 1234, 1 -> doesnt work

But if I 'use' the item I set in the xml the script works properly and then with the admin with the command

/storage player, 1234, 0 -> It stops working

So why it doesnt work to run in but it works to stop it?

Because it's an action, the script only starts when using an item, which mean it can only be controlled after using the item hence the effect not being able to start just by setting the storage. if you want to have the same effects with a command just use this script:
LUA:
local storage = 1234
function onSay(cid, words, param)
	local pid = 0
	if(param == '') then
		pid = getCreatureTarget(cid)
		if(pid == 0) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
			return true
		end
	else
		pid = getPlayerByNameWildcard(param)
	end

	if(not pid) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " is not currently online.")
		return true
	end
	if getCreatureStorage(pid, storage) > 0 then
		doCreatureSay(cid, 'utevo res "Pig', TALKTYPE_ORANGE_1) 
		local pig = doSummonCreature("Pig", getCreaturePosition(cid))
		doConvinceCreature(cid, pig)
		addEvent(shroom, 1000,pid)
	else
		doPlayerSendCancel(cid, "He's on the shroom affect already.")
	end
return true
end

function shroom(cid)
	if getCreatureStorage(cid, storage) > 0 then
			local a,b,c = {EAST,WEST,SOUTH,NORTH}, {"Holy cows, is that a flying pig!?", "Oh DUDE, I think I am seeing my mother in law!", "ITS A GIANT PIG", "A PURPLE PIG WTF"}, 0
			doCreatureSetLookDirection(cid, a[math.random(1,#a)])
			doCreatureSay(cid, b[math.random(1,#b)], TALKTYPE_ORANGE_1)
			if c < 6 then
				c = c+1
				addEvent(shroom,1000,cid)
			else
				doPlayerSendTextMessage(cid, 21, "Was that a fun trip, bro?")
				setPlayerStorageValue(cid,storage,-1)
			end
	end
end
!command Player Name
 
Last edited:
OK once removed it from actions and tested in talkactions I use: !command (set in actions.xml) nameoftheplayer and it says:

He's on the shroom affect already.

But he doesnt do anything else (I have tested it with 5 players that hadnt even log in today)

mhh what im doing wrong?

pd: it says utevo res ina "pig but player doesnt become a ping, it summons like 10 pings but it doesnt transform in one :P
 
OK once removed it from actions and tested in talkactions I use: !command (set in actions.xml) nameoftheplayer and it says:

He's on the shroom affect already.

But he doesnt do anything else (I have tested it with 5 players that hadnt even log in today)

mhh what im doing wrong?

pd: it says utevo res ina "pig but player doesnt become a ping, it summons like 10 pings but it doesnt transform in one :P

oh lol, I thought utevo res ina was supposed to summon, i'll fix the script in a bit (im in a LoL match).
 
oh lol, I thought utevo res ina was supposed to summon, i'll fix the script in a bit (im in a LoL match).

Dont worry, but dont do it I dont like to spam more your time. Actually this script is better than the one I had though.

Check ur mailbox and tell me how to do that is the only I want :P (cast another spell)
 
Back
Top