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
 

Can someone spiff this up a bit?

Previous Thread :: Next Thread 
TheHoIyOne is not online. TheHoIyOne
Joined: 20 Nov 2014
Total Posts: 145
22 Jul 2015 05:25 PM
This works, and is smoothly animated by the body pos (Cant use renderstepped and cframe because its a SS. Couldnt anyways; its ugly)

But.. im looking for something a bit cooler. Please spiff it up. Heres mine!

game:GetService("RunService").Stepped:connect(function()
for i = 1,#Tablets do
Tablets[i].TabletPos.position = Character.Torso.CFrame*CFrame.Angles(0,math.rad(i*360/#Tablets),0)*CFrame.new(0,0,-2*#Tablets).p
end
end)
Report Abuse
TheHoIyOne is not online. TheHoIyOne
Joined: 20 Nov 2014
Total Posts: 145
22 Jul 2015 10:14 PM
This is my new version of it:

game:GetService("RunService").Stepped:connect(function()
if not TabletsModel or not Character then return end
local Tablets = TabletsModel:GetChildren()
for i = 1,#Tablets do
if Tablets[i].Parent == TabletsModel and Tablets[i].Name == "Tablet" then
if #Tablets >= 5 then
Tablets[i].TabletPos.position = Character.Torso.CFrame*CFrame.Angles(0,math.rad(i*360/#Tablets),0)*CFrame.new(0,0,-3*#Tablets).p
else
Tablets[i].TabletPos.position = Character.Torso.CFrame*CFrame.Angles(0,math.rad(i*360/#Tablets),0)*CFrame.new(0,0,-5*#Tablets).p
end
end
end
end)
Report Abuse
baldo46 is not online. baldo46
Joined: 28 Jul 2008
Total Posts: 1254
22 Jul 2015 10:31 PM
game:GetService("RunService").Stepped:connect(function()
if (not TabletsModel) or (not Character) then return end
local Tablets = TabletsModel:GetChildren()
local num = (#Tablets >= 5) and -3 or -5;
for ind,val in pairs(Tablets) do
if --[[val.Parent == TabletsModel *this is redundant*and]] val.Name == "Tablet" then
val.TabletPos.position = Character.Torso.CFrame
*CFrame.Angles(0,math.rad(ind*360/#Tablets),0)
*CFrame.new(0,0,num*#Tablets).p;
end
end
end)
Report Abuse
TheHoIyOne is not online. TheHoIyOne
Joined: 20 Nov 2014
Total Posts: 145
22 Jul 2015 10:34 PM
you only edited it

i wanted to make the rot cooler
Report Abuse
baldo46 is not online. baldo46
Joined: 28 Jul 2008
Total Posts: 1254
22 Jul 2015 10:37 PM
I made it more efficient. You don't need to calculate the number -5 or -3 every time if it's the same for each thing. It's wasteful. That's a precious .03 seconds you're wasting.
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