|
| 12 Jan 2013 05:18 PM |
local walk = script.Parent:findFirstChild("Humanoid")
while true do wait(math.random(1, 15))
n = math.random(1, 10) t = math.random(1, 3) walk.WalkToPoint = Vector3.new(math.random(1, 50),math.random(1, 5),math.random(1, 50)) if n == 1 then wait(math.random(1, 10)) walk.Jump = true else end
end
The script is supposed to make a model I made move around randomly in intervals of 1 to 15 seconds, and to have a 33% chance to jump every time the script runs through. But nothing happens, and I do not get any output. It may be line 8 with WalkToPoint, because whenever I changed my model's WalkToPoint vector3 values manually, nothing happens as well.
Help? |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2013 05:27 PM |
Tl;dr version:
So the script makes the model jump, but doesn't make it walk. Help me? |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2013 05:29 PM |
humanoid:MoveTo(v) should do what you want.
¬ LuaLearners Writer |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2013 05:34 PM |
| MoveTo is a vector3 right? |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2013 05:35 PM |
MoveTo is a method of humanoid, and its argument is a vector3.
you call it like this:
humanoid:MoveTo(Vector3.new(1, 1, 1))
¬ LuaLearners Writer |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2013 05:46 PM |
local walk = script.Parent:findFirstChild("Humanoid")
while true do wait(math.random(1, 15))
n = math.random(1, 10) t = math.random(1, 3) walk:MoveTo(Vector3.new(math.random(1, 100),0,math.random(1, 100))) if n == 1 then wait(math.random(1, 10)) walk.Jump = true else end
end
It still will not work..? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 12 Jan 2013 11:54 PM |
@doom, humanoid's walkto method has a second argument
hum:MoveTo(position, part)
instead of
model:MoveTo(position)
- What have the mini-mods come to nowadays? - |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 12:01 AM |
If you're trying to get it to teleport, then use this:
local character = script.Parent while true do wait(math.random(1, 15)) n = math.random(1, 10) t = math.random(1, 3) character:MoveTo(Vector3.new(math.random(1, 100),0,math.random(1, 100))) if n == 1 then wait(math.random(1, 10)) walk.Jump = true else end end
Or walking to you'd need a part to move to:
local walk = script.Parent:findFirstChild("Humanoid") while true do wait(math.random(1, 15)) n = math.random(1, 10) t = math.random(1, 3) walk:MoveTo(Vector3.new(Workspace.Part.Position, Workspace.Part)) if n == 1 then wait(math.random(1, 10)) walk.Jump = true else end end |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 13 Jan 2013 12:02 AM |
@cody,
* walk:MoveTo(Workspace.Part.Position, Workspace.Part)
- What have the mini-mods come to nowadays? - |
|
|
| Report Abuse |
|
|
| |
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 13 Jan 2013 12:04 AM |
@op, here -
local walk = script.Parent:findFirstChild("Humanoid")
while true do wait(math.random(1, 15))
n = math.random(1, 10) t = math.random(1, 3) walk:MoveTo(Vector3.new(math.random(1, 50),math.random(1, 5),math.random(1, 50)),walk.Parent.Torso) if n == 1 then wait(math.random(1, 10)) walk.Jump = true --Doesn't work anymore else end
end
- What have the mini-mods come to nowadays? - |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 12:05 AM |
"walk.Jump = true --Doesn't work anymore"
Doesn't work? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 12:06 AM |
| Ah, nevermind. It works in the command bar. |
|
|
| Report Abuse |
|
|