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: Getting coins in workspace, and spinning all of them

Previous Thread :: Next Thread 
xXRALXx is not online. xXRALXx
Joined: 12 Mar 2008
Total Posts: 153
02 Jul 2014 08:07 PM
for _, coin in pairs(script.Parent:GetChildren()) do
if coin:IsA('Part') and coin.Name == "Coin" then

while true do
coin.CFrame = coin.CFrame * CFrame.fromEulerAnglesXYZ (0,0.125,0)
wait(0.01)
end
end
end



Only one spins.
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
02 Jul 2014 08:08 PM
while wait() do
for _, coin in pairs(script.Parent:GetChildren()) do
if coin:IsA('Part') and coin.Name == "Coin" then
coin.CFrame = coin.CFrame * CFrame.fromEulerAnglesXYZ (0,0.125,0)
wait(0.01)
end
end
end
Report Abuse
xXRALXx is not online. xXRALXx
Joined: 12 Mar 2008
Total Posts: 153
02 Jul 2014 08:10 PM
It spins all coins, but only one at a time.
Report Abuse
xXRALXx is not online. xXRALXx
Joined: 12 Mar 2008
Total Posts: 153
02 Jul 2014 08:19 PM
bibimbump
Report Abuse
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
02 Jul 2014 08:24 PM
function Spin(part)
Spawn(function()
while wait(.01) do
part.CFrame = part.CFrame*CFrame.fromEulerAnglesXYZ(0,.125,0)
end
end)
end

for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA'BasePart' and v.Name == "Coin" then
Spin(v)
end
end
Report Abuse
xXRALXx is not online. xXRALXx
Joined: 12 Mar 2008
Total Posts: 153
02 Jul 2014 08:37 PM
Thanks, it worked!
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