local loaded = script.Parent.Parent.Parent.Parent.Loaded
local IL = script.Parent
while true do
wait()
IL.Rotation = IL.Rotation + 0.1
if loaded.Value == true then
break
end
end
The script is a local script inside of the spinning part,
However it does not make the thing spin.
If you could help that’d be awesome.
Cheers,
Local script does not run in the workspace; Consider changing it to script
Since the Rotation property is not replicated between server and client, also consider changing it to some different property that can change the orientation of the part
This wasn’t defined in your original post. Rather it was defined as a part.
On another note, and a bit off topic, you can simply do IL.Rotation += 0.1. Also, you should be using task.wait() instead of just wait(). This won’t fix anything, but it’s good to know.
Oh and you can do if loaded.Value then instead of if loaded.Value == true then as an if statement only checks for if a statement is true or false. This also works in the case of objects/variables as it will equal to true if it exists in the first place. Nil and false will both return as false.
(Again this won’t fix anything, but the more you know.)
If there are no errors at all, your script should work as you’ve intended, however, it does not, which means the outer factor is affecting the script itself
You should try this:
local loaded = script.Parent.Parent.Parent.Parent.Loaded
local IL = script.Parent
while true do
wait()
IL.Rotation = IL.Rotation + 0.1
print(IL.Rotation)
if loaded.Value == true then
print("Loop Broke")
break
end
end
The one I suggested to you is not a fix, instead, it is the same code but includes the debugging.
Once you’ve run it, could you share the output of the script?
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhh, sorry for wasting your time guys. It was just spinning really really slow. Hope you have a good day! Thanks for the help.
local loaded = script.Parent.Parent.Parent.Parent:WaitForChild('Loaded')
It’s important not to forget to do this with needed, to avoid situations where code may load faster than objects have loaded (which would obviously cause issues).