View difference between Paste ID: bSVfJgVV and BMWw6rWp
SHOW: | | - or go back to the newest paste.
1-
local player = game.Players.LocalPlayer
1+
local sizem = 3
2-
local character = player.Character
2+
3-
local mouse = player:GetMouse()
3+
local terrainmaterial = ("Slate")
4
5-
game.Workspace.Terrain.WaterTransparency = 0.5
5+
local screengui = Instance.new("ScreenGui")
6-
game.Workspace.Terrain.WaterReflectance = 1
6+
screengui.Parent = game.Players.LocalPlayer.PlayerGui
7
8
textbutton11 = Instance.new("TextButton")
9
textbutton11.Parent = screengui
10
textbutton11.Text = ("Set Material")
11
textbutton11.Position = UDim2.new(0, 0, 0.476, 0)
12
textbutton11.Size = UDim2.new(0, 126, 0, 18)
13
textbutton11.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
14
textbutton11.TextColor3 = Color3.new(240, 240, 240)
15
textbutton11.BackgroundTransparency = (0)
16
textbutton11.BorderSizePixel = (0)
17
local textbar12 = Instance.new("TextBox")
18
textbar12.Parent = screengui
19-
					game.Workspace.Terrain:FillBlock(CFrame.new(v.Position.X, v.Position.Y, v.Position.Z), Vector3.new(v.Size.X * 3, v.Size.Y * 3, v.Size.Z * 3), ("Water"))
19+
textbar12.Position = UDim2.new(0, 0, 0.512, 0)
20
textbar12.Size = UDim2.new(0, 126, 0, 18)
21
textbar12.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
22
textbar12.TextColor3 = Color3.new(240, 240, 240)
23
textbar12.BackgroundTransparency = (0)
24
textbar12.BorderSizePixel = (0)
25
textbar12.Text = ("Slate")
26
27
function onClick()
28-
				game.Workspace.Terrain:FillBlock(CFrame.new(w.Position.X, w.Position.Y, w.Position.Z), Vector3.new(w.Size.X * 1, w.Size.Y * 1, w.Size.Z * 1), ("Slate"))
28+
	terrainmaterial = (textbar12.Text)
29
end
30
31
textbutton11.MouseButton1Click:Connect(onClick)
32
33
while true do
34
	wait(0.01)
35
	game.Workspace.Terrain:Clear()
36
	for i,w in pairs(game.Workspace:getChildren()) do
37
		if w.ClassName == ("Model") then
38
			for i,v in pairs(w:GetChildren()) do
39
				if v.ClassName == ("Part") then
40
					v.Transparency = 1
41
					if v:FindFirstChild("face") ~= nil then
42
						v.face:Destroy()
43
					end
44
					game.Workspace.Terrain:FillBlock(CFrame.new(v.Position.X, v.Position.Y, v.Position.Z), Vector3.new(v.Size.X * sizem, v.Size.Y * sizem, v.Size.Z * sizem), terrainmaterial)
45
				end
46
				if v.ClassName == ("Accessory") then
47
					v:Destroy()
48
				end
49
			end
50
		end
51
		if w.ClassName == ("Part") then
52
			if w.Size.X < 100 and w.Size.Y < 100 and w.Size.Z < 100 then
53
				game.Workspace.Terrain:FillBlock(CFrame.new(w.Position.X, w.Position.Y, w.Position.Z), Vector3.new(w.Size.X * sizem, w.Size.Y * sizem, w.Size.Z * sizem), terrainmaterial)
54
			end
55
		end
56
	end
57
end