I could not synchronize an object :(
hello size I am trying to place instances in the coins of my game and the same with the enemies. The coin is created when I place it in the room, my goal is that if someone takes the coin and it is eliminated, no one else can do it. The code for the coin is this: event collide with obj player
///Collect the coin
//Play 'Coin' sound
audio_play_sound(snd_coin, 0, false);
//Increment branch warp counter
if (instance_exists(obj_warpbranch)) {
with (obj_warpbranch) coins++;
}
//Increment coins
global.coins++;
//Get 50 points
score += 50;
//Destroy
instance_destroy();
gms_instance_sync(id, is_full)
//Create sparkle effect
with (instance_create(x,y,obj_smoke))
sprite_index = spr_sparkle;
if you did, put gms_instance_sync next to instance_destroy(); because I want it to be synchronized when the coin is destroyed when caught by a player, I would appreciate it if you help me
Replies (1)
Last message on 21 Jan 2023
Size43
(Administrator)
on
21 Jan 2023, 18:39:38