I'm trying to make a GUI that floods the entire map. I have the scripting done, I just need to make it so everyone can see it, not just the person who used the GUI if that makes any sense. Here are the 2 scripts I am using: Part creator:
function onclick()
local character = script.Parent.Parent.Parent.Parent.Character
local p = Instance.new("Part")
local posX = character.LowerTorso.Position.X
local posY = character.LowerTorso.Position.Y
local posZ = character.LowerTorso.Position.Z
p.Anchored = true
p.CanCollide = false
p.Name = "Flooder"
p.Material = "SmoothPlastic"
p.Transparency = 0.5
p.BrickColor = BrickColor.new("Light blue")
p.Parent = game.Workspace
p.Position = Vector3.new(posX-0,posY-2,posZ-5)
p.Size = Vector3.new(1024,20,1024) --change to map size (middle determines the height of the water)
end
script.Parent.MouseButton1Click:Connect(onclick)
Flooder:
function onclick()
game.Workspace.Terrain:FillBlock(game.Workspace.Flooder.CFrame, game.Workspace.Flooder.Size, Enum.Material.Water)
game.Workspace.Flooder:Destroy()
end
script.Parent.MouseButton1Click:Connect(onclick)
Any help would be appreciated! Thanks! :D

3 comments
why not just put the code in a server script?
How could I do that with a GUI?
You need a RemoteEvent to :FireAllClients and have a local script waiting for the event to occur. If you want here’s an article on RemoteEvents: https://developer.roblox.com/en-us/api-reference/class/RemoteEvent