Rotation Not Working Roblox Scripting Help

Hi, here is my code:

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

One word: Orientation

Also, this too if the LocalScript isn’t running within the Player or the Player’s Character.

assuming ur making a loading screen

local IL = script.Parent

repeat 
	IL.Rotation += 0.1
	wait()
until game:IsLoaded()

It’s in a StarterGui in StarterGui

I’ll try that, thanks for the reply

Again, it is in Startergui, so that is defiantly not the problem

Orientation is not a valid member or property of any gui part btw

Make sure to check whether the loop is alive or dead during the period, I assume your loop breaks when the value of the loaded instance is true.

Its default set to false (it is a boolvalue btw) and I never set it to true.

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.

Never said it was a part. I just said “Part” in the script. Sorry If that confused you. I’ll try what you suggest

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

I tried all of your suggestions. Nothing seams to be working. Is there a certain property on the gui instance that should be checked?

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.

One thing to add to this:

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).

The script is a local script inside of the spinning part

Try and be a little clearer (less ambiguous) in future.