RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"A roblox game where everything is 2d and controlled by GUI"
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local GuiService = game:GetService("GuiService") local PlayerGui = Instance.new("ScreenGui") PlayerGui.Name = "PlayerGui" local PlayerFrame = Instance.new("Frame") PlayerFrame.Name = "PlayerFrame" PlayerFrame.Size = UDim2.new(1, 0, 1, 0) PlayerFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) PlayerFrame.BackgroundTransparency = 0.5 PlayerFrame.Parent = PlayerGui local PlayerControls = Instance.new("Frame") PlayerControls.Name = "PlayerControls" PlayerControls.Size = UDim2.new(0.3, 0, 0.3, 0) PlayerControls.Position = UDim2.new(0.35, 0, 0.35, 0) PlayerControls.BackgroundColor3 = Color3.fromRGB(255, 255, 255) PlayerControls.BackgroundTransparency = 0.5 PlayerControls.Parent = PlayerFrame local MoveUpButton = Instance.new("TextButton") MoveUpButton.Name = "MoveUpButton" MoveUpButton.Size = UDim2.new(0.3, 0, 0.3, 0) MoveUpButton.Position = UDim2.new(0, 0, 0, 0) MoveUpButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) MoveUpButton.BackgroundTransparency = 0.5 MoveUpButton.Text = "Move Up" MoveUpButton.Parent = PlayerControls local MoveDownButton = Instance.new("TextButton") MoveDownButton.Name = "MoveDownButton" MoveDownButton.Size = UDim2.new(0.3, 0, 0.3, 0) MoveDownButton.Position = UDim2.new(0, 0, 0.7, 0) MoveDownButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) MoveDownButton.BackgroundTransparency = 0.5 MoveDownButton.Text = "Move Down" MoveDownButton.Parent = PlayerControls local MoveLeftButton = Instance.new("TextButton") MoveLeftButton.Name = "MoveLeftButton" MoveLeftButton.Size = UDim2.new(0.3, 0, 0.3, 0) MoveLeftButton.Position = UDim2.new(0.7, 0, 0, 0) MoveLeftButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) MoveLeftButton.BackgroundTransparency = 0.5 MoveLeftButton.Text = "Move Left" MoveLeftButton.Parent = PlayerControls local MoveRightButton = Instance.new("TextButton") MoveRightButton.Name = "MoveRightButton" MoveRightButton.Size = UDim2.new(0.3, 0, 0.3, 0) MoveRightButton.Position = UDim2.new(0.7, 0, 0.7, 0) MoveRightButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) MoveRightButton.BackgroundTransparency = 0.5 MoveRightButton.Text = "Move Right" MoveRightButton.Parent = PlayerControls local Player = Players.LocalPlayer local function movePlayer(direction) if direction == "up" then Player.Character.HumanoidRootPart.CFrame = Player.Character.HumanoidRootPart.CFrame + Vector3.new(0, 0, 1) elseif direction == "down" then Player.Character.HumanoidRootPart.CFrame = Player.Character.HumanoidRootPart.CFrame + Vector3.new(0, 0, -1) elseif direction == "left" then Player.Character.HumanoidRootPart.CFrame = Player.Character.HumanoidRootPart.CFrame + Vector3.new(-1, 0, 0) elseif direction == "right" then Player.Character.HumanoidRootPart.CFrame = Player.Character.HumanoidRootPart.CFrame + Vector3.new(1, 0, 0) end end MoveUpButton.MouseButton1Click:Connect(function() movePlayer("up") end) MoveDownButton.MouseButton1Click:Connect(function() movePlayer("down") end) MoveLeftButton.MouseButton1Click:Connect(function() movePlayer("left") end) MoveRightButton.MouseButton1Click:Connect(function() movePlayer("right") end) PlayerGui.Parent = Player:WaitForChild("PlayerGui")