kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:37 PM |
This script is spose to make my Pig, Mr.Cibbles move/jump randomly. But I can't figure out how to make it do that...
local MaxInc = 15 local Humanoid = script.Parent.Humanoid while true do wait(math.random(2, 6)) end
Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart) if math.random(1, 2) == 1 then Humanoid.Jump = true end
|
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:41 PM |
| Mr.Cibbles need to move people! |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:45 PM |
| Mr.Cibbles is getting mad. |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:46 PM |
| Mr.Cibbles is about to be eaten by a wolf! Hurry fix the script so he can run way! |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:49 PM |
Mr.Cibbles got eaten...
TIme to make Mrs.Cibbels run way! |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:51 PM |
Mr.Cibbles "Im dieing!!" "Dies" Msr.Cibbles "NOOOOOO I MUST AGENVENGE YOU" Mr.Cibbles "Dead" Mrs.Cibbles "I must run" Mrs.Cibbles "NOO I CANT" Wolf "I will eat you Ha ha ha" |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2013 10:53 PM |
Actually, the wolf was a disguise. I ate him! :3
He was yummy! :P |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
| |
|
| |
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:57 PM |
Its half free models okay....? I tried...
Its spose to make my pig move randomly give my a brake please... |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 10:59 PM |
local CurrentPart = nil local MaxInc = 15 local Humanoid = script.Parent.Humanoid while true do wait(math.random(2, 6)) end
Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart) if math.random(1, 2) == 1 then Humanoid.Jump = true end
|
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
| |
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 22 Jun 2013 11:06 PM |
"CurrentPart" can not be nil.
Your "while" loop stop the code from continuing.
The variable "Torso" is not define.
|
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 11:08 PM |
This works but its full of trash so I tried to shorten it.
local CurrentPart = nil local MaxInc = 15
function onTouched(hit) if hit.Parent == nil then return end
local humanoid = hit.Parent:findFirstChild("Hunt")
if humanoid == nil then CurrentPart = hit end end
function waitForChild(parent, childName) local child = parent:findFirstChild(childName)
if child then return child end
while true do print(childName)
child = parent.ChildAdded:wait()
if child.Name==childName then return child end end end
local Figure = script.Parent local Humanoid = waitForChild(Figure, "Hunt") local Torso = waitForChild(Figure, "Torso") local Left = waitForChild(Figure, "Left Leg") local Right = waitForChild(Figure, "Right Leg")
Humanoid.Jump = false
Left.Touched:connect(onTouched) Right.Touched:connect(onTouched)
while true do wait(math.random(2, 6))
if CurrentPart ~= nil then if math.random(1, 2) == 1 then Humanoid.Jump = true end
Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart) end end |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 11:13 PM |
| Im not going to stop bumping this script so unless you help me it wont go away. |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 22 Jun 2013 11:17 PM |
............ ........... ........' ........ ...... .. ... .... . . . . BUMP!!!!!!!!!!!!!!!!!!!!! |
|
|
| Report Abuse |
|
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 22 Jun 2013 11:34 PM |
UGH...
local MaxInc = 15
while true do wait(math.random(2, 6)) local Torso = script.Parent:FindFirstChild("Torso") local Humanoid = script.Parent:FindFirstChild("Humanoid") if Torso and Humanoid then Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), Torso) if math.random(1, 2) == 1 then Humanoid.Jump = true end end end |
|
|
| Report Abuse |
|
|
| |
|