Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Placement script
- --Written by filipono120 studios
- -- Locals/Services:
- local Player = game.Players.LocalPlayer
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local mouse = Player:GetMouse()
- --===============================
- local NetworkAccess = coroutine.create(function()
- settings().Physics.AllowSleep = false
- wait(math.random(1.5, 3))
- while true do
- game:GetService('RunService').RenderStepped:Wait()
- for _, players in pairs(game.Players:GetChildren()) do
- if players ~= game.Players.LocalPlayer then
- players.MaximumSimulationRadius = 0.1
- players.SimulationRadius = 0
- end
- end
- player.MaximumSimulationRadius = math.pow(math.huge, math.huge)
- player.SimulationRadius = math.huge * math.huge
- end
- end)
- coroutine.resume(NetworkAccess)
- --===============================
- wait(1 / 60)
- --===============================
- local Character = Player.Character
- --Gear Remover
- Player.Backpack:ClearAllChildren()
- Player.CharacterAdded:Connect(function()
- Player.Backpack:ClearAllChildren()
- end)
- --Blocks:
- local Blocks = {
- ["Grass"] = {
- Title = "Grass";
- SurfaceType = Enum.SurfaceType.Universal;
- Color = BrickColor.new("Bright green");
- Size = Vector3.new(3, 3, 3);
- KeyCode = Enum.KeyCode.One;
- Fallable = false;
- Anchored = true;
- },
- ["Gravel"] = {
- Title = "Gravel";
- SurfaceType = Enum.SurfaceType.Universal;
- Color = BrickColor.new("Medium stone grey");
- Size = Vector3.new(3, 3, 3);
- KeyCode = Enum.KeyCode.Two;
- Fallable = true;
- Anchored = true;
- },
- ["Sand"] = {
- Title = "Sand";
- SurfaceType = Enum.SurfaceType.Universal;
- Color = BrickColor.new("Cool yellow");
- Size = Vector3.new(3, 3, 3);
- KeyCode = Enum.KeyCode.Three;
- Fallable = true;
- Anchored = true;
- },
- };
- --Uncategorized:
- local Selected = 1
- local GridSize = 3
- local posX
- local posZ
- local SelectorKeyCode = {
- ["One"] = Blocks.Grass.KeyCode;
- ["Two"] = Blocks.Gravel.KeyCode;
- ["Three"] = Blocks.Sand.KeyCode;
- }
- --Functions
- local function CreateBlock(Color, Size, FillSurface, Anchored, Fallable)
- local Block = Instance.new("Part", workspace)
- posX = math.floor(mouse.Hit.Position.X + GridSize)
- posZ = math.floor(mouse.Hit.Position.Z + GridSize)
- Block.Name = Player.Name
- Block.CFrame = CFrame.new(posX, mouse.Hit.Position.Y + 1.5, posZ)
- Block.TopSurface = FillSurface
- Block.LeftSurface = FillSurface
- Block.RightSurface = FillSurface
- Block.BackSurface = FillSurface
- Block.FrontSurface = FillSurface
- Block.BottomSurface = FillSurface
- Block.Size = Size
- Block.BrickColor = Color
- Block.Anchored = Anchored
- while wait() do
- local raycast = Ray.new(Block.Position, Vector3.new(0, -1.8, 0))
- local object, hit, normal = workspace:FindPartOnRayWithIgnoreList(raycast, {Block, Character})
- if not object and Fallable == true then
- Block.Position = Block.Position - Vector3.new(0, .5, 0)
- end
- end
- end
- local function CreateUI(Text)
- --Instances:
- local MineUI = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- --Properties:
- MineUI.Name = "MineUI"
- MineUI.Parent = Player:WaitForChild("PlayerGui")
- MineUI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame.Parent = MineUI
- Frame.AnchorPoint = Vector2.new(0.5, 0.5)
- Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Frame.Position = UDim2.new(0.499637812, 0, 0.890693545, 0)
- Frame.Size = UDim2.new(0, 391, 0, 41)
- Frame.Style = Enum.FrameStyle.RobloxRound
- Frame.Visible = false
- TextLabel.Parent = Frame
- TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel.BackgroundTransparency = 1.000
- TextLabel.Position = UDim2.new(0, 0, -0.073170729, 0)
- TextLabel.Size = UDim2.new(1, 0, 1, 5)
- TextLabel.Font = Enum.Font.Sarpanch
- TextLabel.Text = Text
- TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TextLabel.TextScaled = true
- TextLabel.TextSize = 14.000
- TextLabel.TextWrapped = true
- Frame.Visible = true
- TextLabel.Text = Text
- wait(3.5)
- Frame.Visible = false
- MineUI:Destroy()
- end
- --Main script
- if game:GetService("RunService"):IsServer() then error("This script needed to be local (client) in order to work.") end;
- UserInputService.InputBegan:Connect(function(input, GPE)
- if GPE then return end
- if input.KeyCode == Blocks.Grass.KeyCode then
- Selected = 1
- CreateUI(Blocks.Grass.Title)
- elseif input.KeyCode == Blocks.Gravel.KeyCode then
- Selected = 2
- CreateUI(Blocks.Gravel.Title)
- elseif input.KeyCode == Blocks.Sand.KeyCode then
- Selected = 3
- CreateUI(Blocks.Sand.Title)
- elseif input.KeyCode == Enum.KeyCode.Zero then
- Selected = 0
- end
- end)
- mouse.Button1Down:Connect(function()
- if Selected == 1 then
- CreateBlock(Blocks.Grass.Color, Blocks.Grass.Size, Blocks.Grass.SurfaceType, Blocks.Grass.Anchored, Blocks.Grass.Fallable)
- elseif Selected == 2 then
- CreateBlock(Blocks.Gravel.Color, Blocks.Gravel.Size, Blocks.Gravel.SurfaceType, Blocks.Gravel.Anchored, Blocks.Gravel.Fallable)
- elseif Selected == 3 then
- CreateBlock(Blocks.Sand.Color, Blocks.Sand.Size, Blocks.Sand.SurfaceType, Blocks.Sand.Anchored, Blocks.Sand.Fallable)
- elseif Selected == 0 then
- if mouse.Target.Name == Player.Name then
- mouse.Target:Destroy()
- end
- end
- end)
- Character["Humanoid"].Died:Connect(function()
- script:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement