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

TalkAction Shovel & Rope

Amirosloo

Banned User
Joined
Feb 9, 2012
Messages
33
Reaction score
13
Hello
Im learning to script and this is my first script!
This may be useful for some OTs, When u say !stuck it takes 1 cc and gives u a rope and a shovel
Tested on 0.4 and 0.3.6pl1

Make a file in talkactions/scripts/ Stuck.lua
Lua:
function onSay(cid, words, param)
    if doPlayerRemoveMoney(cid, 10000) then 
	    doPlayerAddItem(cid, 2554)
	    doPlayerAddItem(cid, 2120)
	    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doCreatureSay(cid,"WOOOHO, IM FREE!",TALKTYPE_ORANGE_1)
    else
             doPlayerSendCancel(cid, "Sorry, but you dont have enough money!")
             doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
    return TRUE
end

And dont forget to add this in talkactions.xml
XML:
	<talkaction words="!stuck" event="script" value="Stuck.lua"/>
 
Last edited:
b7a0fe1df5.jpg
 
Be patient. Its his first script and It looked well. Lol, I remember when i was so happy to just create an actionscript that is giving 100 gold coins.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
						local goldId = 2148
																doPlayerAddItem(cid, goldId,100)
	return true
end
With fucked up tabs :D
But he just need to learn how to tab, otherwise it looks very good for a newbie.
Should be like this:

Lua:
function onSay(cid, words, param)
	if doPlayerRemoveMoney(cid, 10000) then 
		doPlayerAddItem(cid, 2554)
		doPlayerAddItem(cid, 2120)
		doSendMagicEffect(getCreaturePosition(cid), 39) 
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
		doCreatureSay(cid,"WOOOHO, IM FREE!",TALKTYPE_ORANGE_1)
	else
		doPlayerSendCancel(cid, "Sorry, but you dont have enough money!")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return TRUE
end
 
Last edited:
Code:
		doSendMagicEffect(getCreaturePosition(cid), 39) 
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
same effect twice? :p:p
 
Back
Top