ID:167533
 
how do i make a barrier and can you tell me how to make it :
all be destroyed if one part goes,
allows the user to go through it,
be destroyed when its hp is 0
Try to make your posts a bit more grammatically correct...

Regarding your question, it is pretty easy to do:

turf/Barrier
icon = 'Insert Your Icon Here.dmi'
icon_state = "Insert Your Icon State If Any"
var
hp = 10
Enter(atom/movable/A)
if(ismob(A))
if(A.client)
return 1
else
return 0


That code gives it hp and allows players (Only players, not NPCs) to go through.

For disappearing when there is no HP, that is up to you. Make whatever you decide to have damage it deduct hp, then have an if statement or seperate proc with the if statement checking for HP.
Then, after the if, add a del(Insert Whatever Variable you are using to represent the Barrier here)

In response to Bobthehobo
thatks i could use this for the teleporter but it dosent work i had to delete the line '((A,Client))' it need to be a mob so it can be attacked just like a normal player but that still isnt all of the code i needed.
when one of the barriers is broken all ned to break,
they need to have def and hp as a mob
and I CAT MAKE A CIRCILAR ICON FOR THE 9 SQUERS!!!!! some advice plz
In response to Edge657123
turf/barrier
var/hp=5
Enter(var/atom/movable/a)
if(istype(a,/mob))
src.hp--
if(src.hp<=0) for(var/turf/barrier/t in world) del(t)
else return 1