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

Lua Need a script

Byllan

Member
Joined
Dec 29, 2009
Messages
1,079
Reaction score
12
Location
SWEDEN
Need a script there you kill a monster and a teleport summons so you come to the quest room for tfs 0.3.6 GIVE REP!
 
creaturescripts/?.lua
Code:
function onDeath(cid, corpse, killer)

registerCreatureEvent(cid, "GhazbaranTeleport") -- Eventname

local creaturename = getCreatureName(cid)
local in_pos = {x=477, y=233, z=9, stackpos=2} -- Teleport pos
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=450, y=242, z=10, stackpos=1} -- Reward room? pos
local time_to_pass = 60 -- in seconds
local tpID = 1387

if creaturename == 'Ghazbaran' then -- Creature name

teleport = doCreateTeleport(tpID, to_pos, in_pos)

doSendMagicEffect(in_pos, CONST_ME_TELEPORT)

doCreatureSay(cid, "You have 60 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
addEvent(removeTeleport4, (1000*time_to_pass))


end
end

function removeTeleport4()
if getThingfromPos({x=477, y=233, z=9, stackpos=1}).itemid == 1387 then -- Teleport pos all 3 lines
doRemoveItem(getThingfromPos({x=477, y=233, z=9, stackpos=1}).uid,2)
doSendMagicEffect({x=477, y=233, z=9, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

creaturename?.xml
Find </flags> and paste this after:
Code:
<script>
<event name="Eventname?"/>
</script>
Creaturescripts.xml
Code:
	<event type="death" name="eventname?" event="script" value="?.lua"/>
 
This is how every monsterfile looks like inside, this is taken from rotworm.xml
Code:
	<flags>
		<flag summonable="0"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="1"/>
		<flag pushable="0"/>
		<flag canpushitems="0"/>
		<flag canpushcreatures="0"/>
		<flag targetdistance="1"/>
		<flag staticattack="90"/>
		<flag runonhealth="0"/>
	</flags>
-- here you should paste script things.
	<attacks>
 
Back
Top