ID:178219
![]() Jun 7 2002, 2:18 pm
|
|
i didnt find what i needed on the Lib or Demo's >.< but here's what i need , I want it so if a user Bumps into a Certain Obj Then the Obj moves in teh direction of the user's dir.If you could do this please reply :) Thanks Again, Newbie Signing Out
|
Copyright © 2025 BYOND Software.
All rights reserved.
Bump(atom/movable/A) // src Bump()ed into A
if(istype(A,/obj/pushblock))
var/obj/pushblock/P = A // get a pushblock alias to A
var/dir2block = get_dir(src,P)
// may not be the same as src.dir if src is moving sideways
var/turf/block_destination = get_step(P,dir2block)
var/turf/mob_destination = P.loc
if(P.Move(block_destination)) // if P can move to the destination
// try to move here again, and preserve the current dir
Move(mob_destination, dir)