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

Help with unfinished scary script

Appzyt

New Member
Joined
Jun 1, 2008
Messages
92
Reaction score
0
Ohoy ohoy!

Soon its halloween and I want to give my players on my server a treat with this scary house. Im getting my inspiration from F.E.A.R the game.

What do I want? -
When u step on a tile you first get a storage value so u cant step on it again.
When u step on this tile an NPC called Alma will appear on certain location, NPC will say something and then after 5 seconds be gone.

Lua:
local config = {
				npc = "Alma", --- This is the NPC name
				text = {"You are in my realm now."}, --- NPC will say this
				storage = 123456, --- When stepped on tile storage is added.
				pos = {
						{x=1068, y=512, z=4}, --- The NPC summons here
				      }
 
			   }
 
		--No more config--
		--Script starts here--
function onStepIn(cid, item, position, fromPosition)

		if item.uid == 7788 then
		setPlayerStorageValue(cid, config.storage, 1)
		doCreateNpc(config.npc, spawnPos)
		doCreatureSay(getCreatureByName("Alma"), config.text, 1)
		
	end
return true
end

This is what I have come up with so far and hoping someone might help me finnish it.

Regards,
Appz
 
if doRemoveCreature dont work for u with NPC's (on my sometimes dont work)
try to do it with monster

script will spawn monster (like rabbit, who dont attack anybody) and add him 2 attack, first after 1 (eg) sec will say something and second spell after 5 will selfdestruct. Set corpse to 0, and done :D

and for this part you can choose:
PHP:
function onStepIn(cid, item, position, fromPosition)
 
		if item.uid == 7788 then
                     if getPlayerStorageValue(cid, config.storage) ~= -1 then
		                  setPlayerStorageValue(cid, config.storage, 1)
		                  doCreateNpc(config.npc, spawnPos)
		                  doCreatureSay(getCreatureByName("Alma"), config.text, 1)
                     else
                           doTeleportThing(cid,getCreaturePos(cid).x-1)   -- for example
                     end
	end
return true
end
 
Lua:
local t = {
	npc = 'Alma', --- This is the NPC name
	text = 'You are in my realm now.', --- NPC will say this
	storage = 123456, --- When stepped on tile storage is added.
	pos = {x=1068, y=512, z=4}
}
 
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) and getPlayerStorageValue(cid, t.storage) == -1 then
		setPlayerStorageValue(cid, t.storage, 1)
		local v = doCreateNpc(t.npc, t.pos)
		doCreatureSay(v, t.text, TALKTYPE_SAY)
		addEvent(doRemoveCreature, 5000, v)
	end
end
 
Back
Top