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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 09 Dec 2014 10:13 AM |
.resume & .create*
--ThatChristianGuy |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|