Difference between revisions of "SetScript"
Jump to navigation
Jump to search
→Notes: Added method for script activation on items
imported>Haama (→Notes: Specifics for RunScriptLine usage) |
imported>Shademe (→Notes: Added method for script activation on items) |
||
|
*It seems that setting the script won't start it up. For instance, if you use '''player.SetScript rScript''' the script will be added to the player ('''player.GetScript''' will be rScript), but no blocks will run (tested GameMode, onHit, onMagicHit) and '''HasVariable''' will falsely return 0.
**For some scripts, this isn't an issue. For instance, if you set a script to an item and then use '''LocalRef.AddItem Item 1''' the script will run, because '''AddItem''' starts scripts.
***An alternative would be to disable the item and enable it a frame later. This activates the script.
**In the case of the player, however, the only method to start the script is to open the console and type in '''player.ModAV Health 0''', '''player.AddItem F 1''' or even player with the dot '''player.''' Using the functions in a script won't start the script (even '''player.con HairTint 0 0 0''')
***[[RunBatchScript]] works with a text file with a simple '''player.'''.
| |||