|
Re: Low Health [message #325692 is a reply to message #315780] |
Wed, 09 April 2008 03:27 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
Yes, attaching a script there with one line stops you having to add that script to each player preset in level edit.
Obviously when the player dies the script is destroyed too, which is why that's a good place to add it, as it attaches to the player each time he is ::Created.
There are other ways and other places to attach sc ripts to a player, such as the m00_grant (can't remember the rest), but this is a good place as any I guess.
|
|
|
|
Re: Low Health [message #325699 is a reply to message #315780] |
Wed, 09 April 2008 04:39 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
That's a terrible way to attach it to a player. When that code is called the player isn't always a GameObject * yet. He exists in the server but hasn't always loaded or the server hasn't created his object yet.
If you try to attach a script to him at that point you're not gauranteed it will attach.
Also, it will only attach it to him once, when he dies it wouldn't re-attach unless he left the server and re-joined.
[Updated on: Wed, 09 April 2008 05:11] Report message to a moderator
|
|
|