I'm currently trying to get the instance mouse of a player, using a LocalScript, and then allowing a Script to use this object value. However, the script I have right now doesn't work. There are no errors, and the InstanceMouse value does not change. Please help.
The following code is inside of a LocalScript. There are two values, InstancePlayer and InstanceMouse.
local mouse = script.InstancePlayer.Value:GetMouse() script.InstanceMouse.Value = mouse -- This (InstanceMouse) is an ObjectValue script.Parent.Disabled = true
Maybe try something like this:
Add a RemoteFunction to ReplicatedStorage and name it "Mouse"
Client Code:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local MouseEvent = ReplicatedStorage:WaitForChild("Mouse") local Player = game:GetService("Players").LocalPlayer function MouseEvent.OnClientInvoke() return Player:GetMouse() end
Server Code:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local MouseEvent = ReplicatedStorage:WaitForChild("Mouse") local Mouse = MouseEvent:InvokeServer()
From there, you can use the variable "Mouse" just like you would in any other script