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

Some scripts [NPC, Creature] TFS 0.3.5pl1

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello.
I need few scripts ! (requesting !):
TFS 0.3.5pl1

1) NPC An npc who after say "Enigma" teleport you to X:Y:Z and add you black skull

2) Creaturescript If player have Black skull, other players cant attack you and you cannot attack them.

3) NPC NPC who teleport you to 2 locations:
- Dragonia - x:y:z - after teleporting to Dragonia, NPC remove you black skull.
- Flame Island - x:y:z
after teleporting the NPC remove you black skull
 
Last edited:
Try this:
Code:
2) Creaturescript If player have Black skull, other players cant attack you and you cannot attack them.
Creaturevents:
LUA:
<event type="combat" name="bsprotection" event="script" value="script.lua"/>
In login.lua:
LUA:
registerCreatureEvent(cid, "bsprotection")
New lua file:
LUA:
local skullId = 5

function onCombat(cid, target)
    if isPlayer(cid) and isPlayer(target) and getCreatureSkullType(cid) == skullId then
        doPlayerSendCancel(cid, 'You cannot attack players.')
        return false
	elseif isPlayer(cid) and isMonster(target) and getCreatureSkullType(cid) == skullId then
		return true
    end  
    if isPlayer(cid) and isPlayer(target) and getCreatureSkullType(target) == skullId then
        doPlayerSendCancel(cid, 'You cannot attack players with blackskull.')
		return false
	elseif isPlayer(cid) and isMonster(target) and getCreatureSkullType(cid) == skullId then
		return true
    end  
    return true
end
not tested so report errors
 
Last edited:
@ Up
Rep+++
Zero errors in console :) but
i dont know if it works in-game because i need NPC's :
1) NPC An npc who after say "Enigma" teleport you to X:Y:Z and add you black skull

&

3) NPC NPC who teleport you to 2 locations:
- Dragonia - x:y:z - after teleporting to Dragonia, NPC remove you black skull
- Flame Island - x:y:z


BUMP
rpyo
i s
n t
g
 
Last edited:
try these npcs
the first:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Egnima teleporter" floorchange="0" walkinterval="2000">
	<health now="150" max="150"/>
	<look type="132" head="56" body="800" legs="10" feet="38" addons="3"/>

  <interaction range="3" idletime="30">

    <interact keywords="hi" focus="1">
      <!--These are the keywords will trigger this interaction-->
      <keywords>hello</keywords>
      <keywords>greet</keywords>
      <response>
        <action name="script" ><![CDATA[
            selfSay( "Hello, " .. getCreatureName(cid) .. ", Do you want to travel to {Enigma}?",cid)
        ]]></action>
      </response>
      </interact>

    <interact keywords="enigma">
      <response>
		<action name="script" ><![CDATA[
			local newpos = {x = 1000,y = 1000,z = 7}
			doCreatureSetSkullType(cid, 5)
			setPlayerStorageValue(cid,4325,1)
			doTeleportThing(cid, newpos)
        ]]></action>
        <action name="idle" value="1"/>
      </response>
    </interact>
	
    <interact keywords="bye" focus="0">
      <keywords>farewell</keywords>
      <response text="Good bye. Recommend us, if you were satisfied with our service."/>
    </interact>


    <!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
    <interact event="onPlayerLeave" focus="0">
      <response text="Bye, hope to see you later!"/>
    </interact>

  </interaction>

</npc>
and the second npc:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Dragonia and Flame Island teleporter" floorchange="0" walkinterval="2000">
	<health now="150" max="150"/>
	<look type="132" head="56" body="800" legs="10" feet="38" addons="3"/>

  <interaction range="3" idletime="30">

    <interact keywords="hi" focus="1">
      <!--These are the keywords will trigger this interaction-->
      <keywords>hello</keywords>
      <keywords>greet</keywords>
      <response>
        <action name="script" ><![CDATA[
            selfSay( "Hello, " .. getCreatureName(cid) .. ", Do you want to travel to {Dragonia} or {Flame Island}?",cid)
        ]]></action>
      </response>
      </interact>

    <interact keywords="Dragonia">
      <response>
		<action name="script" ><![CDATA[
			local newpos = {x = 1000,y = 1000,z = 7}
			doCreatureSetSkullType(cid, 0)
			setPlayerStorageValue(cid,4325,-1)
			doTeleportThing(cid, newpos)
        ]]></action>
        <action name="idle" value="1"/>
      </response>
    </interact>
	
	<interact keywords="Flame Island">
      <response>
		<action name="script" ><![CDATA[
			local newpos = {x = 1000,y = 1000,z = 7}
			doCreatureSetSkullType(cid, 0)
			setPlayerStorageValue(cid,4325,-1)
			doTeleportThing(cid, newpos)
        ]]></action>
        <action name="idle" value="1"/>
      </response>
    </interact>
	
    <interact keywords="bye" focus="0">
      <keywords>farewell</keywords>
      <response text="Good bye. Recommend us, if you were satisfied with our service."/>
    </interact>

    <!--This event triggers if the player goes to far away from the npc/logout/idle timeout-->
    <interact event="onPlayerLeave" focus="0">
      <response text="Bye, hope to see you later!"/>
    </interact>

  </interaction>

</npc>
not tested but should work. it teleport you to the citeis for free and give/remove blackskull.
don't forget to change positions.

I have changed the talk range and i think the problem is fixed in npc 2

and add this in you login.lua before registercreaturevents
LUA:
if getPlayerStorageValue(cid,4325) == 1 then
	doCreatureSetSkullType(cid, 5)
end
it make you have skull even if you logout.
 
Last edited:
@Up
NPC works correctly but - i want change range of checking words like 10 sqms (now i can only say "hi" about face-to-face) with npc... [where to change it ? ]
second NPC dont teleport you to second place (all i set correctly)

and bug with Creaturescript:
player with black skull cant attack monsters ( i requested to only dont attack players not monsters ) and if player relog, he dont get black skull :/, i want only the NPC can remove (dont after log out).
 
Last edited:
LUA:
function onCombat(cid, target)
    if getCreatureSkullType(cid) == 5 and isPlayer(target) then
       return false
    end
    if isPlayer(cid) and getCreatureSkullType(target) == 5 then
       return false
    end
 return true
end
 
Back
Top