ID:170046
 
turf
slide
icon = 'Turf.dmi'
icon_state = "slide"
Entered(mob/M)
if(ismob(M))
if(M.dir == SOUTH)
sleep(0.5)
step(M,M.dir)
else
return 1

I tried this and it doesnt seem to work, it only slides if you walk south but people can still walk ontop of it normally
There is a difference between Enter() and Entered()
Your using Entered() which occurs when the "target" has successfully Enter()ed the turf.

Try switching to Enter().
turf 
slide
icon = 'Turf.dmi'
icon_state = "slide"
Enter(mob/M) //Switched from Entered to Enter because Enter() comes before the "target" moves into the turf.
if(ismob(M))
if(M.dir == SOUTH)
sleep(0.5)
step(M,M.dir)
else
return 1 //Don't think you need the 1 there.
In response to Vermolius
hmm cant walk south now although can walk in any other direction without the slide function working
In response to Vermolius
The problem with that is that, if you enter the slide walking south, you are told to try and enter it again. You never actually stand on the slide, if you see what I'm saying? You need to set their location to the slide directly, then move them.

The return 1 should be return ..() too. Otherwise, people can always walk over the slide turf, no matter who's there.
In response to Sheepywoolyfluff
To have it work with other directions, just remove
if(M.dir == SOUTH)
....
In response to Dever
thats what i want it to do...its doing the opposite
In response to Jp
Jp wrote:
The problem with that is that, if you enter the slide walking south, you are told to try and enter it again. You never actually stand on the slide, if you see what I'm saying? You need to set their location to the slide directly, then move them.

how do i do this?
turf
slide
icon='Turf.dmi'
icon_state="slide"
Entered(mob/m)
if(ismob(m))
sleep(0.5)
step(m,SOUTH)
In response to Sheepywoolyfluff
Say m is the mob you want to move, and src is the slide.

Then you would say m.loc = src. That puts you directly on the slide, without calling Enter() or Entered() So you can slide freely.

That code should probably be in Entered() anyway. Then you can do away with density checking or setting the location. Like this:

turf/Slide
Entered(mob/m)
if(ismob(m)) // Check it is a mob that entered
m.Move(locate(x,y-1,z)) // Move the mob south
In response to Jp
thanx that works