Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I rotate part on the players client?

Asked by 8 years ago

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)


0
What's the problem? Looks fine to me. Uglypoe 557 — 8y
0
opps, I meant on your client, no one elses. So when a part rotates no one else can see it LittleBigDeveloper 245 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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!

0
Thank! :) LittleBigDeveloper 245 — 8y
0
Any time (: User#11440 120 — 8y
Ad

Answer this question