Thread: Small question
View Single Post
  #2  
Old 03-16-2005, 03:03 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Idrox0
how do you set a variable to a string? Namely, speed = #t(1);
If you're using the old scripting engine then you'll need to use setstring ('setstring nameofstring,newvalue;'). The new GScript makes things a little easier; the code that you gave would work.

Quote:
This is not going to be needed for a while, but how would I be able to script a weapon that hits multiple areas that are close together, but does not hurt the target multiple times?
Well, as a starter - and you may already know this - damage scripts are the kind of thing that should take place on the server. So if it's an immediate thing then you should send a trigger. If it's the result of a projectile then you can just receive the default notification. Stefan made a tutorial on this kind of thing that you might find useful: http://forums.graalonline.com/forums...ad.php?t=50809

In either case, you'll probably want to use the 'getnearestplayers' function to get a list of players near to the damage area and then iterate through them all to determine which should be affected. I've never used the function personally, but it's included in the tutorial I linked and it seems fairly simple.
__________________
Reply With Quote