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

How would I rotate part on the players client?

I want to rotate a part only on a players client, I have this script so far.

script.Parent.MouseEnter:connect(function()
	script.Parent.Parent.Frame.BackgroundColor3 = Color3.new(12/255, 62/255, 0/255)
end)

script.Parent.MouseLeave:connect(function()
	script.Parent.Parent.Frame.BackgroundColor3 = Color3.new(20/155, 108/255, 2/255)
end)

script.Parent.MouseButton1Down:connect(function()
	for i = 1,90 do
		game.Workspace.Block.CFrame = game.Workspace.Block.CFrame * CFrame.fromEulerAnglesXYZ(0,0, -1)
		wait(0.01)
	end
end)


2 comments

0

What's the problem? Looks fine to me.

0

opps, I meant on your client, no one elses. So when a part rotates no one else can see it

1 answer

✓ Accepted answer

Use a Local Script

In order to make things local, you have to use a localScript.

I didn't read your script but I'm assuming you know how to make a part rotate.

All you have to do it place your code in a local script located inside the Player. Any changes made with a LocalScript will remain Local.

This only works with FE, FilteringEnabled.

If FE is not enabled I think you could still make things local by inserting parts into the Player's Current Camera and changing the part from there. I'm not sure about this though, I use FE.

Good Luck!

2 comments

0

Thank! :)

0

Any time (:

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