I’m using remote events. Here’s some of the code in my local script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local mouse = localPlayer:GetMouse()
local RemoteEvent = ReplicatedStorage.RemoteEvent
while true do
wait(5)
RemoteEvent:FireServer(mouse.Hit.p.X, mouse.Hit.p.Z)
end
As you can see, I’m firing a remote event and passing in the x-position and z-position of Mouse.Hit. Some of the code from the server script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage.RemoteEvent
function func(x, z)
print(x)
print(z)
end
RemoteEvent.OnServerEvent:connect(func)
The values being printed are “TheCreator1944” and a number value that changes depending on the position of my mouse. Does anyone know why my username is being returned instead of the x-position of Mouse.Hit?