Hello! So I am trying to remove this piece of water (terrain) when a player uses a click detector, but when I click, it gives me this message: "attempt to index upvalue 'water' (a nil value)" I tought that it works like an Instance.new, but I am probably wrong, well, here's the code:
local water = game.Workspace.Terrain:FillBlock(game.Workspace.WaterPart.CFrame, game.Workspace.WaterPart.Size, Enum.Material.Water) script.Parent.ClickDetector.MouseClick:Connect(function() water:Destroy() end)
Thank you.
I fixed it. I forgot that you were able to fill areas with Enum.Material.Air.