I have a script that causes models to face the direction of my mouse, but only I am able to see it, and no one else.
Is there a way to make the script allow everyone to see it?
(another question, how do I make it only detect my mouse, and no one else’s mouse?)
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
local Arm = game.Workspace.SpotlightLeft.Holder
local Head = game.Workspace.SpotlightLeft.Light
local Arm2 = game.Workspace.SpotlightRight.Holder
local Head2 = game.Workspace.SpotlightRight.Light
Mouse.Move:Connect(function()
local MousePosition = Mouse.Hit.Position
local direction = Vector3.new(MousePosition.X,Arm.WorldPivot.Position.Y,MousePosition.Z)
Arm:PivotTo(CFrame.new(Arm.WorldPivot.Position, direction))
end)
Mouse.Move:Connect(function()
local MousePosition = Mouse.Hit.Position
Head:PivotTo(CFrame.new(Head.WorldPivot.Position, MousePosition))
end)
Mouse.Move:Connect(function()
local MousePosition = Mouse.Hit.Position
local direction = Vector3.new(MousePosition.X,Arm.WorldPivot.Position.Y,MousePosition.Z)
Arm2:PivotTo(CFrame.new(Arm2.WorldPivot.Position, direction))
end)
Mouse.Move:Connect(function()
local MousePosition = Mouse.Hit.Position
Head2:PivotTo(CFrame.new(Head2.WorldPivot.Position, MousePosition))
end)