Hi there, scripters!
I have a problem with my turret script, which is intended to point towards the seat occupant's mouse coordinates, but it isn't sending a remote function that requests the mouse coordinates from a local script. I've had tons of problems with remote functions/events that send signals to the client before. Any help is appreciated!
server sided script:
seat = script.Parent.Seat
turretbase = script.Parent.TurretBase
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
while seat.Occupant ~= nil do
local direction = script.Parent.GetMouse:InvokeClient(game.Players:FindFirstChild(seat.Occupant.Parent.Name),seat.Occupant)
turretbase.CFrame = CFrame.new(turretbase.Position,direction)
wait(0.1)
end
end)
client sided script (local script)
mouse = game.Players.LocalPlayer:GetMouse()
function script.Parent.GetMouse.OnClientInvoke(player,occupant)
return mouse.hit.p
end

1 comment
Please help if you can, I can't seem to fix it! I've tried parenting the local script to ReplicatedFirst, but that doesn't work!