|
| 04 May 2014 02:09 PM |
its a script that makes a spinning effect with a circle of lights but its becoming unsynced by 2 seconds after the first loop
http://www.roblox.com/test-item?id=155974300
if you can tell me how to fix the unsync it would be great |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 May 2014 02:25 PM |
| ;/ no one wants to read the 6 lines of very basic code |
|
|
| Report Abuse |
|
|
|
| 04 May 2014 02:57 PM |
| No one attempted to look at it ;/ |
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 04 May 2014 02:58 PM |
We're lazy Paste the code in your forum if you want help |
|
|
| Report Abuse |
|
|
|
| 04 May 2014 03:08 PM |
There is a total of 8 blocks with minor changes of wait() I think this is how it went
--this is in Pointlight 1 while true do script.Parent.Enabled = false wait(2)
script.Parent.Enabled = true wait(16) end
In the next point light is while true do script.Parent.Enabled = false wait(2)
script.Parent.Enabled = true wait(18) end
In the next pointlight is while true do script.Parent.Enabled = false wait(2)
script.Parent.Enabled = true wait(20) end
ect...
It gives the looping effect for 1 loop but then it goes out of sync for 2 seconds |
|
|
| Report Abuse |
|
|
|
| 04 May 2014 03:18 PM |
| Its just easier to look at it hen trying to understand what I said |
|
|
| Report Abuse |
|
|
| |
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 04 May 2014 03:36 PM |
It'd be easier trying to do this in one script Put all the parts in a model (name them Part1, Part2, ect.) Put this script inside the model
local main = script.Parent local currentIndex = 1 local lights = { -- Add more if you need it main.Part1.PointLight main.Part2.PointLight main.Part3.PointLight }
function advanceIndex() currentIndex = currentIndex + 1 if currentIndex > #lights then currentIndex = 1 end end
function returnCurrentAndPrevious() local currlight = lights[currentIndex] local prev = currentIndex - 1 if prev < 1 then prev = #lights end local prevlight = lights[prev] return currlight, prevlight end
function switchOff(targ) targ.Enabled = false end
function switchOn(targ) targ.Enabled = true end
while wait(1) do local l1, l2 = returrnCurrentAndPrevious() switchOn(current); switchOff(Previous) advanceIndex() end
|
|
|
| Report Abuse |
|
|
| |
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 04 May 2014 03:59 PM |
Whoops, forgot to put commas in that table
local lights = { -- Add more if you need it main.Part1.PointLight, main.Part2.PointLight, main.Part3.PointLight, }
|
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 04 May 2014 04:02 PM |
Actually, the script I gave you is full of holes
Try this instead
local main = script.Parent local currentIndex = 1 local lights = { -- Add more if you need it main.Part1.PointLight, main.Part2.PointLight, main.Part3.PointLight }
function advanceIndex() currentIndex = currentIndex + 1 if currentIndex > #lights then currentIndex = 1 end end
function returnCurrentAndPrevious() local currlight = lights[currentIndex] local prev = currentIndex - 1 if prev < 1 then prev = #lights end local prevlight = lights[prev] return currlight, prevlight end
function switchOff(targ) targ.Enabled = false end
function switchOn(targ) targ.Enabled = true end
while wait(1) do local l1, l2 = returnCurrentAndPrevious() switchOn(l1); switchOff(l2) advanceIndex() end |
|
|
| Report Abuse |
|
|
|
| 04 May 2014 04:21 PM |
Why do you have so many functions?
Lights = {} Potato = 7 -- Change for the amount of lights you need for i = 1, Potato do table.insert(Lights,script.Parent["Part" .. i].PointLight) script.Parent["Part" .. i].PointLight.Enabled = false end while true do for i,v in pairs(Lights) do v.Enabled = not v.Enabled wait(.1) v.Enabled = not v.Enabled end end |
|
|
| Report Abuse |
|
|