trying to position the model to the position of the mouse and it keeps printing the player’s name instead of the position of the mouse and not working because of that.
local turret = game.ServerStorage.Turret
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(pos)
local turretclone = turret:Clone()
for i,v in pairs (turretclone:GetChildren()) do
if v:IsA("MeshPart") or v:IsA("Part") then
v.Position = Vector3.new(pos)
print(pos)
end
end
end)
this is the server remote listener and this is the client script
local player = game.Players.LocalPlayer
local plrmouse = player:GetMouse()
plrmouse.Button1Down:connect(function(pos)
local pos = plrmouse.Hit.p
local remoteevent = game.ReplicatedStorage.RemoteEvent
print(pos)
remoteevent:FireServer(pos)
end)