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

Sacred Papers

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
The script don't work, please help-me!!

Script1:
PHP:
function onUse(cid, item, frompos, item2, topos)
	if item.id == 7720 then
		doSummonCreature("tarantula", fromPos)
		doCreatureSay(cid, (getCreatureName(cid)) created a tarantula, TALKTYPE_ORANGE_1)
		doConvinceCreature(cid, tarantula, fromPos)
		doRemoveItem(item.uid, 1)

	elseif item.id == 7702 then
		doSummonCreature("rotworm", fromPos)
		doCreatureSay(cid, (getCreatureName(cid)) created a rotworm, TALKTYPE_ORANGE_1)
		doConvinceCreature(cid, rotworm, fromPos)
		doRemoveItem(item.uid, 1)

	elseif item.id == 7844 then
		doSummonCreature("cyclops", fromPos)
		doCreatureSay(cid, (getCreatureName(cid)) created a cyclops, TALKTYPE_ORANGE_1)
		doConvinceCreature(cid, cyclops, fromPos)
		doRemoveItem(item.uid, 1)

	elseif item.id == 7845 then
		doSummonCreature("troll", fromPos)
		doCreatureSay(cid, (getCreatureName(cid)) created a troll, TALKTYPE_ORANGE_1)
		doConvinceCreature(cid, troll, fromPos)
		doRemoveItem(item.uid, 1)

	elseif item.id == 7846 then
		doSummonCreature("dark monk", fromPos)
		doCreatureSay(cid, (getCreatureName(cid)) created a dark monk, TALKTYPE_ORANGE_1)
		doConvinceCreature(cid, dark monk, fromPos)
		doRemoveItem(item.uid, 1)
         end
return 1
end

Script2:
PHP:
	<action itemid="7720" script="sacred_papers.lua" />
	<action itemid="7702" script="sacred_papers.lua" />
	<action itemid="7844" script="sacred_papers.lua" />
	<action itemid="7845" script="sacred_papers.lua" />
	<action itemid="7846" script="sacred_papers.lua" />

Help-me!!!
 
@Colandus:
Why can you write
Code:
local monster = monsters[item.itemid]  
    if monster then
monster = "tarantula" in this case... so
Code:
if "tarantula" then
? wtf?
 
@Markey;

You should look at first bombas post, then you will know why.

And, you can take a look at Colandus' table tutorial, it might help you to understand :thumbup:
 
@Colandus:
Why can you write
Code:
local monster = monsters[item.itemid]  
    if monster then
monster = "tarantula" in this case... so
Code:
if "tarantula" then
? wtf?

if "tarantula" then? Do you know what that does? It's like not having any if-statement at all.

if-statments:
PHP:
if true then
    -- it's true, this will happen
else
    -- it's false or nil, this will happen
end

All values except for false or nil are true. 1 == true, "lol" == true also "1 > 0" is true and "1 > 1" is false ^.-

And nil, is for example when a variable is not declared, or when a table index has no value, which is what I was using in that script ^.^
 
Back
Top