ID:268469
 
How do i make traps? ex.Ones that stop chars from moving for a certain amount of time and ones that will kill them.
Mecha, these are the kind of questions that YOU have to answer for yourself. We can't tell you how to make your game. We don't know how movement in your game works so we can't tell you how to stop chars. We don't know how death in your game works so we can't tell you how to kill chars. These are things you have to figure out on your own. That's why you learn to program, so you'll understand how to do it yourself. If you can't figure it out right now, leave it alone and do something else for a while.
turf
spike_trap
icon = 'blah.dmi'
Entered(mob/M)
if(ismob(M))
M <<"Ouch! Those spikes hurt!"
//Perform death, or health drop
net_trap
icon = 'blah.dmi'
layer = MOB_LAYER + 1
Entered(mob/M)
if(ismob(M))
M <<"You struggle but are stuck in the net for awhile!"
M.locked = 1
sleep(20)
M.locked = 0
M <<"You break free!"

mob/var/locked = 0

mob.Move()
if(locked == 1)
return 0
else
..()


Enjoy
In response to Foomer
Ok thanx, but all i wanted was a example so i could tweak it to make it work for my game..Thats what us programmers do..
In response to Mecha Destroyer JD
Mecha Destroyer JD wrote:
Ok thanx, but all i wanted was a example so i could tweak it to make it work for my game..Thats what us programmers do..


Your'e Wrong.
In response to Mecha Destroyer JD
Okay, I've got a test for you to run.
mob/verb/programmingtest()
var/string="programmer"
if(findtext(string,"copier")) world<<"Yes, you are correct, Mecha Destroyer JD."
else world<<"It would seem as though you are incorrect, Mecha Destroyer JD."


Let me know how that works out for you.
In response to Goz
lmao! programmers don't just tweak code, thats what n00b's do. Real programmers write there own code, I mean, were do you think all this stuff your "tweaking" comes from anyway? If there were no people coding, just tweaking, were would all the code that people tweak come from?
In response to Jermman
wow...so philisophical, lol.