generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Why?

Previous Thread :: Next Thread 
UFAIL2 is not online. 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
HaileyForever is not online. HaileyForever
Joined: 01 Oct 2011
Total Posts: 1496
09 Nov 2011 04:52 PM
If we were mind-readers, we would know what you want it to do.
Report Abuse
UFAIL2 is not online. 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
HaileyForever is not online. HaileyForever
Joined: 01 Oct 2011
Total Posts: 1496
09 Nov 2011 04:55 PM
OH, don't give me that!
TELL ME THE **WHOLE SCRIPT'S FUNCTION**!
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
09 Nov 2011 05:00 PM
I already fixed it.
Report Abuse
UFAIL2 is not online. 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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 05:24 PM
I know the answer.
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
09 Nov 2011 05:32 PM
So, post the answer.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 05:35 PM
Why?
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
09 Nov 2011 05:39 PM
Because you want to help me.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 05:40 PM
I don't want to help you.
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
09 Nov 2011 05:44 PM
:3
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 05:45 PM
*how do you like my imitation of you?*

:3 is for noobs. Get out.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
09 Nov 2011 05:47 PM
^

Awww yea.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 05:52 PM
ohhhh no
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
09 Nov 2011 05:56 PM
whyyy not
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 05:57 PM
awww yeah
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
09 Nov 2011 05:57 PM
ohhhh kayy....
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 05:58 PM
ehhhhh maybe
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
09 Nov 2011 05:59 PM
awww yeah
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 06:00 PM
ahhhhh yea
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
09 Nov 2011 06:00 PM
ummm why
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 06:02 PM
uhhhhhh dunno
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
09 Nov 2011 06:04 PM
hmmmm bai
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
09 Nov 2011 06:05 PM
ummmmmm okay
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image