I made a game where you can build with blocks in the way similar to old stamper games.
The problem is that all blocks are clientside so if you built something, other players couldn’t see your build.
I tried some ways to fix it but none of them worked.
Here is the model that shows how this game works:
https://www.roblox.com/library/3550586050/Building-system
(I didn’t made the scripts, but took them from a guy who made a tutorial how to make a building system.)
To allow clients to make a request to the server, you’ll need to use RemoteEvents. You can find various tutorials online if you need some resources. Hope this helped
Exactly. As an example
--localscript
local Event = game.ReplicatedStorage.MyRemoteEvent
local Player = game.Player.LocalPlayer
local BlockType = "DIRT"
function placeblock(blocktype)
end
script.Parent.MouseButton1Click:Connect(function()
if BlockType == nil then
print("No block selected!")
else
Event:FireServer(BlockType)
end
And then in a server script…
local Event = game.ReplicatedStorage.MyRemoteEvent
EventTrigger(Player, BlockType)
if BlockType == "DIRT" then
--Code to place blox
end
end
Event.OnServerEvent:Connect(EventTrigger)
The reason it is EventTrigger(Player,BlockType) is when remote events are fired from Local side, they bring Player as their first argument to make life that tiny bit easier