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

GlobalEvent Random Text Over Tiles - Helpful Floor

BlackList

PassingWrath.us
Joined
Aug 30, 2007
Messages
133
Reaction score
26
Hello,
I made a small little script that you pretty much enter any amount of text you want and at random one will be chosen and will be displayed over the floor tile. I use at temple spawn for new players, so you aren't totally clueless. I used some TP sign script just for the simple text display then added the math random. Enjoy!

Code:
function onThink(interval, lastExecution)
local name_of_monster = 'demon' ---  here put monster name or any npc name

local pos = {x=589, y=82, z=7}

local text = {
	"Welcome!",
	"Command: !bless",
	"Command: !spells",
	"Command: !home",
	"Commands: /commands",
	"Potions are infinite!",
	"NPCs can be found all over!",
	"Boat is North/West of here!"
}

local v = text[math.random(#text)]

    doCreatureSay(getCreatureByName(name_of_monster),v,TALKTYPE_ORANGE_1, false, 0, pos)
 return TRUE
end
 
approved

Mmm, why use demon?
Lua:
local name_of_monster = 'demon'

Look:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Demon" nameDescription="a demon" race="fire" experience="0" speed="0" manacost="0">
	<health now="100" max="100"/>
	<look type="35"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="0"/>
		<flag hostile="0"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
	</flags>
        <voices interval="4000" chance="100">
                <voice sentence="Welcome!"/>
                <voice sentence="Command: !bless"/>
                <voice sentence="Command: !spells"/>
                <voice sentence="Command: !home"/>
                <voice sentence="Commands: /commands"/>
                <voice sentence="Potions are infinite!"/>
                <voice sentence="NPCs can be found all over!"/>
                <voice sentence="Boat is North/West of here!"/>
        </voices>
</monster>

Same effect.
 
approved

Mmm, why use demon?
Lua:
local name_of_monster = 'demon'

Look:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Demon" nameDescription="a demon" race="fire" experience="0" speed="0" manacost="0">
	<health now="100" max="100"/>
	<look type="35"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="0"/>
		<flag hostile="0"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
	</flags>
        <voices interval="4000" chance="100">
                <voice sentence="Welcome!"/>
                <voice sentence="Command: !bless"/>
                <voice sentence="Command: !spells"/>
                <voice sentence="Command: !home"/>
                <voice sentence="Commands: /commands"/>
                <voice sentence="Potions are infinite!"/>
                <voice sentence="NPCs can be found all over!"/>
                <voice sentence="Boat is North/West of here!"/>
        </voices>
</monster>

Same effect.

Well you could also do that. It's just I'm just trying to get better use to the scripting system with OTs. Your way would work much better. But this case, I feel with globalevents you could add magiceffects and even further the script. So like Acubens, it's more flexible :) But I do like your idea too. Both are the same concept just different things you can do with.
 
Back
Top