I have tried searching the devforum for the issue but i could not find anything.
Localscript inside of the character
local s = game.Players.LocalPlayer.Character
local h = s:WaitForChild("Humanoid")
local plr = game.Players.LocalPlayer
h:GetPropertyChangedSignal("Sit"):Connect(function()
if h.Sit == true then
print("sitting")
script.Parent.SeatOccupant.Value = true
local lp = game.Players.LocalPlayer
local target = lp:GetMouse()
local t = target.Target
game.ReplicatedStorage.TurretRemotes.MouseEvent:FireServer(lp, t)
else
warn("!nil!")
script.Parent.SeatOccupant.Value = false
end
end)
Server Script inside the seat (unfinished)
local seat = script.Parent
game.ReplicatedStorage.TurretRemotes.MouseEvent.OnServerEvent:Connect(function(lp, t)
print("!!OCCUPANT!!")
local TurretUnion = script.Parent.Parent.Guns
print(lp)
print(t)
while wait() do
local c = TurretUnion:GetPrimaryPartCFrame()
TurretUnion:PivotTo(CFrame.new(c, t.Position))
end
end)
output
t.Position is supposed to be the mouse.target.Position