SphereCommunity
region name - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: region name (/Thread-region-name)



region name - Van Glan Bloom - 06-13-2017 09:43 AM

Hello guys.

I was trying to upgrade one of my scripts, in this case taming, but for some reason it is not working properly.
My intention is for a message to appear in the world, indicating in which area of the world the animal appeared.

Code:
on=@create
serv.b @0123 Attention : a <name> has just appeared in <serv.region.name>

In the game does not appear the message with the indications of the place


RE: region name - darksun84 - 06-13-2017 12:04 PM

<serv.region> it's not a valid command from the server object.

Anyway, the main problem is that in the @create trigger the NPC it's still not placed in the world.
So you have to use a timerf along with a function.
Example:
Code:
[FUNCTION broadcastNpcRegion]
serv.b @0123 Attention : a <name> has just appeared in <region.name>

[CHARDEF c_test_npc]
Name = Test
id = c_man
CAN=MT_WALK|MT_USEHANDS|MT_EQUIP

ON=@Create
npc = brain_human
str = 100
maxhits = 9999
dex = 0
int = 0
mana = 0
timerf 1,broadcastNpcRegion

It works for me also take note that if you write directly the serv.b in the timerf command you will still get a wrong result from <region.name>