This here is my script: I was trying to make it so that the part that gets created is visible for everyone on the server, I know it has something to do with remoteFunctions, but I just can't figure out how to do it. So the big part I was wondering of is how to make it so that the player which want's to place the brick, can place it, and the mouse.Hit.Position would transfer over to the server, so that the brick the player clones from the replicated storage over to the workspace would have the same position as the player which placed that brick. This script works, but only the localplayer which toggled it can see that the brick is placed
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local part = game.Workspace.Pink
UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.P then
local hit = mouse.Hit.Position
local hitX = hit.X
local hitY = hit.Y
local hitZ = hit.Z
local part = game.ReplicatedStorage.Part
local partC = part:Clone()
partC.Parent = game.Workspace
partC.Position = Vector3.new(hitX,hitY,hitZ)
end
end)

9 comments
YES! Thank you so much!! I have only been learning lua for 4 days now, so I'll read through this script and learn a lot, thank you!!
@JesseSong ?
@NoteSalad No problem, happy to help.
Heres an article: https://developer.roblox.com/en-us/api-reference/function/RemoteEvent/FireServer
Please upvote my comment if I am correct
@JesseSong I still don't understand what you mean.
On your :FireServer(hitX) event there was no need to have a parameter like hitX.
Then the server script wouldn't be able to identify it. We need to transfer it over so the server knows what it is, if I don't put hitX in the parameter then the Server Script won't know what 'X' is.
Therefore it will result in either an error or the script will not work properly.