Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is there a orange line stopping my script working?

I may just be stupid however, I want this part to move. But it won't. I don't see how. I'm very new to scripting, so this might be insanely obvious. Here's the script;

print("Hello world!")
MoonRock = game.Workspace.MoonRock

while true do
	wait(2)
	MoonRock.Anchored = false
	wait(1)
	MoonRock.Position = 3.798, 12.292, -64.02
end

There is a line under the MoonRock.Position script. Why is this? How can I fix this?

1 answer

✓ Accepted answer

The red line

The red line under the MoonRock.Position is an error line, meaning the code line is scripted wrong.

The error

So, to do a position... you need to use Vector3. I would look more into Positions through the Scripting Helpers site and the Developer Forums and sites for ROBLOX.

The Script

MoonRock = game.Workspace.MoonRock

while true do
	wait(2)
	MoonRock.Anchored = false
	wait(1)
	MoonRock.Position = Vector3.new(3.798, 12.292, -64.02)
	print("Hello world!")
end

If I helped you with your problem, please accept it as the answer. Thank you!

3 comments

1

thank you!

0

This will only work if "MoonRock" is a part

0

Yes ARJ, that's what this was intended for, if you look at line 5... it uses the variable of MoonRock to be unanchored which means its referencing a part.

This discussion is preserved as it was. New answers, comments, and votes are closed.