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 is this not working?

Previous Thread :: Next Thread 
HolidayWorld is not online. HolidayWorld
Joined: 24 May 2009
Total Posts: 8984
01 Jun 2014 10:17 PM
while true do
wait(5)
Instance.new("Part")
Part.Parent = game.Workspace
Workspace.Part.Position = Vector3.new(72.6, 50.4, -5.5)
Workspace.Part.Anchored = true
Workspace.Part.Position = Vector3.new(72.6, 50.4, -5.5)
game.Workspace.Part.BrickColor = BrickColor.new("Black")
Workspace.Part.Size = Vector.new(5.2, 4.8, 5)
Workspace.Part.Position = Vector3.new(72.6, 50.4, -5.5)
wait(5)
Workspace.Part.Anchored = false
wait(1)
print ("Hello World")



end

All I am trying to do is make a brick insert into workspace every few seconds at that location but it doesn't seem to be working.
Report Abuse
AhtnamasStudio is not online. AhtnamasStudio
Joined: 15 Jan 2014
Total Posts: 1104
01 Jun 2014 10:19 PM
Is there a error?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Jun 2014 10:19 PM
http://wiki.roblox.com/index.php?title=Variables

while Wait(5) do
local Part = Instance.new("Part", Workspace)
Part.Anchored = true
Part.Position = Vector3.new(72.6, 50.4, -5.5)
Part.BrickColor = BrickColor.new("Black")
Part.Size = Vector.new(5.2, 4.8, 5)
Spawn(function()
Wait(5)
Workspace.Part.Anchored = false
Wait(1)
print ("Hello World")
end)
end
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Jun 2014 10:21 PM

while Wait(5) do
local Part = Instance.new("Part", Workspace)
Part.Anchored = true
Part.Position = Vector3.new(72.6, 50.4, -5.5)
Part.BrickColor = BrickColor.new("Black")
Part.Size = Vector.new(5.2, 4.8, 5)
Spawn(function()
Wait(5)
Part.Anchored = false
Wait(1)
print("Hello World")
end)
end

Would be pretty hard to explain Spawn() effectively, but it would create another thread in which it would change the Anchored property. Otherwise, it would halt the script to unanchor then, unless that's what you wanted...
Report Abuse
HolidayWorld is not online. HolidayWorld
Joined: 24 May 2009
Total Posts: 8984
01 Jun 2014 10:27 PM
Yes I want it to unanchor at the time period and now it is not...How would I go about fixing that?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Jun 2014 10:30 PM
while Wait(5) do
local Part = Instance.new("Part", Workspace)
Part.Anchored = true
Part.Position = Vector3.new(72.6, 50.4, -5.5)
Part.BrickColor = BrickColor.new("Black")
Part.Size = Vector.new(5.2, 4.8, 5)
Wait(5)
Part.Anchored = false
Wait(1)
print("Hello World")
end
Report Abuse
HolidayWorld is not online. HolidayWorld
Joined: 24 May 2009
Total Posts: 8984
01 Jun 2014 10:36 PM
Ok thank you very much!
Report Abuse
SuperiorEternal is not online. SuperiorEternal
Joined: 22 Aug 2009
Total Posts: 2365
01 Jun 2014 10:42 PM
while wait(5) do
Part = Instance.new("Part")
Part.Parent = Workspace
Part.Position = Vector3.new(72.6, 50.4, -5.5)
Part.Anchored = true
Part.BrickColor = BrickColor.new("Black")
Part.Size = Vector.new(5.2, 4.8, 5)
wait(5)
Part.Anchored = false
wait(1)
print ("Hello World")
end

1. Don't use while true do when you can use while wait() do, it is more efficient
2.You never named the Part. So I recommend keeping it a variable which is Part
3. Why on earth did you keep resizing the brick to the same size over and over?
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