Author Sticky: Post Working Scripts Here
Aeristoch Posted: Monday, 22 July 03:39AM
Not quite sure if a script like this has been presented or not yet. Considering the sheer amount of scripts daily, it's hard to keep track of them all.

Name: Universal Sign Script

What it does: Uses only one script to send a message to the PC with the name of that sign, when within range of the sign.

How to use it: Place this script in the OnHeartbeat event of the sign. This script gets the name of the sign, not the tag. So if you want a message sent to your PC stating this is "The Thirsty Dragon Inn" you would want to name your sign this by clicking on properties and replacing the generic Merchants Shingle #.

NWScript:
void main()

{   object oPC = GetNearestObject(OBJECT_TYPE_CREATURE, OBJECT_SELF, 1);

    object oSign = OBJECT_SELF;

    string sSign = GetName(oSign);

    

    if(GetIsPC(oPC) && GetDistanceToObject(oPC) <=6.0f)

        SendMessageToPC(oPC, ""+ sSign +".");

}