I’ve been stuck on the same problem for 30 minutes, I keep getting the player instead of the mouse.
I’ve used the :GetMouse() method but it also doesn’t work. (using RemoteEvents from a client script)
Is there a solution for this?
Server:
wait(0.1)
local ss = game:GetService("ServerStorage")
local Jeep = ss:WaitForChild("Jeep")
--local db = false
local tool = script.Parent
local event = tool.ThrowObject
local velocity = 145
event.OnServerEvent:Connect(function(mousePos)
local clone = Jeep:Clone()
local Script = script.JeepDebrisScript:Clone()
Script.Parent = clone
Script.Enabled = true
clone.Parent = workspace.debris
clone.CFrame = CFrame.lookAt(clone.Position, clone.Position, clone.Position)
clone.AssemblyLinearVelocity = Vector3.new(clone.CFrame.LookVector * velocity,10,clone.CFrame.LookVector * velocity)
game:GetService("Debris"):AddItem(clone, 15)
end)
Client:
wait(0.1)
local player = game.Players.LocalPlayer
local plrMouse = player:GetMouse()
local tool = script.Parent
local event = tool.ThrowObject
tool.Activated:Connect(function()
event:FireServer(plrMouse)
end)