Ask coding questions

← Back to all posts
Not working
ROBLOXCODE

I want my character to move, but when I do this:
x = agent.xcor()

def left():
agent = agent.xcor() - 10

agent.goto(x, -100)

def right():
x = agent.xcor() + 10

agent.goto(x, -100)

wn.onkey(left, "left")
wn.onkey(right, "right")

it does not move. Please help me.

Voters
ROBLOXCODE