ID:907571
 
obj
Eltricbolt
var/mob/var/usr.Strength/s // I'm aware this is most likely not possible for calling a mob variable strength, just an example to hope you follow what I'm talking about.
var/mob/o = new(usr)
Bump(B)
if(ismob(B))
var/mob/M =B
if(M == usr)
return
walk_away(B,o,s,0,0)
del src


I see it! It's your source code! Delete it all!


So how do you expect us to help if you don't tell us the problem?

By the way, objects don't have an src var. X.src isn't going to work unless you have it defined yourself.
I don't understand what's being attempted at all with what's included. I do understand 'knockback' but the rest is a mystery to me. It's just so... bad? I'm not sure how exactly to describe it.
He's obviously trying to move a new obj from a null with a delay of compiler error.
I want to use (usr of the proc) Strength variable to be the distance (Bumped mob)steps away or walks away.
mob
verb
CreateBolt()
var/obj/Electricbolt/newbolt = new(loc)
newbolt.s = Strength
newbolt.o = src

obj
Electricbolt
var
s = 1
mob/o
Bump(mob/B)
if(B == o)
return
walk_away(src,o,s,0,0)


I'm still not too sure what you're doing here, but this is my attempt to fix what you showed us.

usr is defined in the reference as;

"This is a mob variable (var/mob/usr) containing the mob of the player who executed the current verb, or whose action ultimately called the current proc."

Since you weren't using a proc or verb, it wasn't a valid use. If you want the 'usr' to be a part of this, you need to define something that allows them to create or use the bolt.

It's important that when you try to set it's variables, you define the type specifically enough to where the compiler is sure it has the variables you're referencing;
var/obj/Electricbolt/newbolt = new(loc)


When defining the Electricbolt obj, just create the variables you want to later modify.

If you only want to call this movement when it bumps into a mob, you can just define B as mob/B.

Since 'o' is the reference to the mob who created the variable, as we set here..

newbolt.o = src


You can check it easily in the condition, and then move right on to the walk_away() proc.

The Ref parameter for walk_away() is the object you'd like to move, and in your case it seems like the Electricbolt itself, so you can just use 'src' and cut out define any new variables.