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 » Scripters
Home Search
 

Re: What's wrong with this

Previous Thread :: Next Thread 
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
09 Dec 2014 10:05 AM
It just somehow inserts one brick into my torso

ply = game:GetService("Players").LocalPlayer
char = ply.Character

function CreateTab()
for i = 1,7 do
wait()
local tab = Instance.new("Part",char.Torso)
tab.FormFactor = "Custom"
tab.Size = Vector3.new(2,3,0.4)
tab.TopSurface = "Smooth"
tab.BottomSurface = "Smooth"
tab.BrickColor = BrickColor.new("Bright red")
tab.Transparency = 0.4
tab.CanCollide = false
tab.Position = Vector3.new(0,10,0)
tab.Name = "Tablet"
local selection1 = Instance.new("SelectionBox",tab)
selection1.Adornee = tab
selection1.Color = tab.BrickColor
while wait() do
tab.CFrame = char.Torso.CFrame * CFrame.Angles((2*math.pi)*(i/7),0,0) * CFrame.new(0,0,-10)
end
end
end

ply.Chatted:connect(function(msg)
if msg:lower() == "tab" then
CreateTab()
end
end)
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Dec 2014 10:11 AM
while wait() do
tab.CFrame = char.Torso.CFrame * CFrame.Angles((2*math.pi)*(i/7),0,0) * CFrame.new(0,0,-10)
end

Derp.

coroutine.wrap(function()
while wait() do
tab.CFrame = char.Torso.CFrame * CFrame.Angles((2*math.pi)*(i/7),0,0) * CFrame.new(0,0,-10)
end
end)();
Report Abuse
ThatChristianGuy is not online. ThatChristianGuy
Joined: 14 Jun 2014
Total Posts: 1283
09 Dec 2014 10:12 AM
What's the difference between doing it like that with .wrap and doing it with .resume?


--ThatChristianGuy
Report Abuse
ThatChristianGuy is not online. ThatChristianGuy
Joined: 14 Jun 2014
Total Posts: 1283
09 Dec 2014 10:13 AM
.resume & .create*


--ThatChristianGuy
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Dec 2014 10:13 AM
Wrapped coroutines are considered 'single use', in a sense. They can of course be used more than once, but once they yield good luck resuming them.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
09 Dec 2014 10:14 AM
It worked now but..After 5 seconds or so they have all dissapeared...Four tablets or so dissapear each until it's none left..
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
09 Dec 2014 11:17 AM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
09 Dec 2014 04:29 PM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
10 Dec 2014 11:42 AM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
10 Dec 2014 12:41 PM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
10 Dec 2014 12:57 PM
bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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