Here is the Script i made;
?!(local Server):exit
_obj = _this select 0
_vdelay = _this select 1
_type = _this select 2
_pos = getPos _obj
_dir = getDir _obj
#alive
?(getdammage _obj < 1): goto "alive"
Hint Format ["%1 Destroyed, It will respawn in %2s", _type, _vdelay]
#Spawn
~_vdelay
deleteVehicle _obj
~1
_obj = _type createVehicle _pos
_obj setDir _dir
Hint Format ["%1 Has Respawned", _type]
goto "init"
the following code is attached to each object i wish to spawn;
[this, 30, "Truck5tReammo"] exec "vehicle.sqs"
the problem is that a vehicle is spawned for every player playing.
when i was testing it on my own it was ok but once i tested it online it kept spawning multiples.
i think it has something to do with the script running on all the computers.
is ?!(local Server):exit wrong?