UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 09 Nov 2011 04:44 PM |
It works, but not the way I want it to. The chicken goes towards the node just fine, makes it there. Then, it waits there until the time reaches 10. I use .magnitude to check if the chicken is close enough to the node to repeat the script, but all it did was sit there. So, I added a print to check how far away the chicken was from the node. The first test, it printed over 30. Why?
Note: This happed after I added in .Lay
local mag local num = 0 local add = 1
function Time() while true do wait(1) num = num + add end end
function Lay() while true do wait((math.random(10, 20))) repeat wait() until mag <= 2 or num == 10 and Workspace:findFirstChild("Node6") == nil local egg = Instance.new("Part") egg.Name = "Egg" egg.Anchored = true egg.BrickColor = BrickColor.new("Institutional white") egg.FormFactor = "Custom" egg.Size = Vector3.new(0.5, 0.75, 0.5) local Mesh = Instance.new("SpecialMesh") Mesh.Parent = egg Mesh.MeshId = "http://www.roblox.com/asset/?id=1527559" Mesh.Scale = Vector3.new(0.25, 0.25, 0.25) script.Parent.Humanoid.PlatformStand = true script.Parent.Torso.Anchored = true egg.Parent = Workspace egg.CFrame = script.Parent.Torso.CFrame wait((math.random(2, 5))) script.Parent.Humanoid.PlatformStand = false script.Parent.Torso.Anchored = false wait(0.5) egg.Anchored = false game.Debris:AddItem(egg, math.random(10, 60)) end end
local time = coroutine.create(Time) local lay = coroutine.create(Lay)
while true do coroutine.resume(lay) wait((math.random(3, 8))) local a = Instance.new("Part") a.Name = "Node" a.Parent = script.Parent a.CFrame = CFrame.new(math.random(0, 60), 1.099, math.random(0, 60)) a.Anchored = true a.CanCollide = false a.Transparency = 1 script.Parent.Humanoid:MoveTo(a.Position, game.Workspace.Base) mag = (script.Parent.Torso.Position - a.Position).magnitude repeat wait() coroutine.resume(time) until mag <= 2 or num == 10 if mag <= 2 then a:remove() else num = 0 a:remove() end end |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2011 04:52 PM |
| If we were mind-readers, we would know what you want it to do. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 09 Nov 2011 04:54 PM |
:l
"use .magnitude to check if the chicken is close enough to the node to repeat the script" |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2011 04:55 PM |
OH, don't give me that! TELL ME THE **WHOLE SCRIPT'S FUNCTION**! |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 09 Nov 2011 05:17 PM |
Another error.
j = (math.random(60, 600)) print(j) wait(j)
It seems not to wait long enough, it wait's less then 20 seconds. |
|
|
| Report Abuse |
|
|
| |
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
| |
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 09 Nov 2011 05:39 PM |
| Because you want to help me. |
|
|
| Report Abuse |
|
|
| |
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
| |
|
|
| 09 Nov 2011 05:45 PM |
*how do you like my imitation of you?*
:3 is for noobs. Get out. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|