Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///scr_include(key_ring, key1, key2, ...)
- /*
- You can use this script to add multiple controllers to a single room, or multiple
- rooms can have a single controller. The key_ring value determines which.
- Must be put in the room start event!
- */
- var keys, key_ring, i;
- key_ring = argument[0];
- keys[0] = argument[1];
- //Sort all listed keys into array, as well as allows for optional arguments.
- if argument_count > 2{
- for(i=1;i<argument_count;i++){
- keys[i-1] = argument[i];
- }
- }
- //Check if key_ring is a room or an object, and act accordingly.
- if room_exists( key_ring ){
- if room = key_ring{
- for(i=0;i<array_length_1d(keys);i++){
- if !instance_exists(keys[i]){
- instance_create(0,0, keys[i]);
- }
- }
- }
- }else{
- for(i=0;i<array_length_1d(keys);i++){
- if room = keys[i] and !instance_exists(key_ring){
- instance_create(0,0,key_ring)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement