Minecraft-like Roblox block game rblx.games/135624152691584
roblox roblox-game rojo

core: cmdr

+186 -2
+1
.gitignore
··· 1 + Packages/
+10 -1
default.project.json
··· 5 5 "ReplicatedStorage": { 6 6 "$className": "ReplicatedStorage", 7 7 "$ignoreUnknownInstances": true, 8 - "$path": "src/ReplicatedStorage" 8 + "$path": "src/ReplicatedStorage", 9 + "Packages": { 10 + "$className": "Folder", 11 + "$path": "Packages" 12 + } 13 + }, 14 + "ReplicatedFirst": { 15 + "$className": "ReplicatedFirst", 16 + "$ignoreUnknownInstances": true, 17 + "$path": "src/ReplicatedFirst" 9 18 }, 10 19 "ServerScriptService": { 11 20 "$className": "ServerScriptService",
+23
src/ServerScriptService/CmdrCommands/ChunkDump.lua
··· 1 + return { 2 + Name = "chunkdump", 3 + Aliases = {"dumpchunk"}, 4 + Description = "Show server-side block count for a chunk.", 5 + Group = "Debug", 6 + Args = { 7 + { 8 + Type = "integer", 9 + Name = "cx", 10 + Description = "Chunk X" 11 + }, 12 + { 13 + Type = "integer", 14 + Name = "cy", 15 + Description = "Chunk Y" 16 + }, 17 + { 18 + Type = "integer", 19 + Name = "cz", 20 + Description = "Chunk Z" 21 + } 22 + } 23 + }
+15
src/ServerScriptService/CmdrCommands/ChunkDumpServer.lua
··· 1 + return function(context, cx, cy, cz) 2 + local terrainGen = require( 3 + game:GetService("ServerScriptService") 4 + :WaitForChild("Actor") 5 + :WaitForChild("ServerChunkManager") 6 + :WaitForChild("TerrainGen") 7 + ) 8 + 9 + local chunk = terrainGen:GetChunk(cx, cy, cz) 10 + local count = 0 11 + for _ in pairs(chunk.data) do 12 + count += 1 13 + end 14 + return ("Chunk %d,%d,%d has %d blocks"):format(cx, cy, cz, count) 15 + end
+49
src/ServerScriptService/CmdrCommands/ResyncChunk.lua
··· 1 + return { 2 + Name = "resyncchunk", 3 + Aliases = {"resyncc"}, 4 + Description = "Resync a chunk (and optional radius) for a player.", 5 + Group = "Debug", 6 + Args = { 7 + { 8 + Type = "player", 9 + Name = "player", 10 + Description = "Player to resync" 11 + }, 12 + { 13 + Type = "integer", 14 + Name = "cx", 15 + Description = "Chunk X" 16 + }, 17 + { 18 + Type = "integer", 19 + Name = "cy", 20 + Description = "Chunk Y" 21 + }, 22 + { 23 + Type = "integer", 24 + Name = "cz", 25 + Description = "Chunk Z" 26 + }, 27 + { 28 + Type = "integer", 29 + Name = "radius", 30 + Description = "Radius around the chunk", 31 + Optional = true, 32 + Default = 0 33 + } 34 + }, 35 + Run = function(context, player, cx, cy, cz, radius) 36 + local tickRemote = game:GetService("ReplicatedStorage"):WaitForChild("Tick") 37 + local r = radius or 0 38 + local count = 0 39 + for y = -r, r do 40 + for x = -r, r do 41 + for z = -r, r do 42 + tickRemote:FireClient(player, "C_R", cx + x, cy + y, cz + z, 0, 0, 0, 0) 43 + count += 1 44 + end 45 + end 46 + end 47 + return ("Resync sent to %s (%d chunks)"):format(player.Name, count) 48 + end 49 + }
+48
src/ServerScriptService/CmdrCommands/ResyncNear.lua
··· 1 + return { 2 + Name = "resyncnear", 3 + Aliases = {"resyncnearby"}, 4 + Description = "Resync chunks around a player's current chunk.", 5 + Group = "Debug", 6 + Args = { 7 + { 8 + Type = "player", 9 + Name = "player", 10 + Description = "Player to resync" 11 + }, 12 + { 13 + Type = "integer", 14 + Name = "radius", 15 + Description = "Radius around the player chunk", 16 + Optional = true, 17 + Default = 1 18 + } 19 + }, 20 + Run = function(context, player, radius) 21 + local character = player.Character 22 + if not character then 23 + return "Player has no character" 24 + end 25 + local root = character:FindFirstChild("HumanoidRootPart") 26 + if not root then 27 + return "Player has no HumanoidRootPart" 28 + end 29 + 30 + local pos = root.Position 31 + local cx = math.round(pos.X / 32) 32 + local cy = math.round(pos.Y / 32) 33 + local cz = math.round(pos.Z / 32) 34 + 35 + local tickRemote = game:GetService("ReplicatedStorage"):WaitForChild("Tick") 36 + local r = radius or 1 37 + local count = 0 38 + for y = -r, r do 39 + for x = -r, r do 40 + for z = -r, r do 41 + tickRemote:FireClient(player, "C_R", cx + x, cy + y, cz + z, 0, 0, 0, 0) 42 + count += 1 43 + end 44 + end 45 + end 46 + return ("Resync sent to %s (%d chunks around %d,%d,%d)"):format(player.Name, count, cx, cy, cz) 47 + end 48 + }
+7
src/ServerScriptService/CmdrServer.server.lua
··· 1 + local ReplicatedStorage = game:GetService("ReplicatedStorage") 2 + local ServerScriptService = game:GetService("ServerScriptService") 3 + 4 + local Cmdr = require(ReplicatedStorage.Packages.cmdr) 5 + 6 + Cmdr:RegisterDefaultCommands() 7 + Cmdr.Registry:RegisterCommandsIn(ServerScriptService.CmdrCommands)
+4 -1
src/StarterGui/Crosshair/LocalScript.client.lua
··· 7 7 local ReplicatedStorage = game:GetService("ReplicatedStorage") 8 8 local UIS = game:GetService("UserInputService") 9 9 10 + local TXTS = game:GetService("TextChatService") 11 + local TXTS_CIF = TXTS:FindFirstChildOfClass("ChatInputBarConfiguration") 12 + 10 13 ReplicatedStorage:WaitForChild("Objects"):WaitForChild("MLLoaded") 11 14 12 15 game:GetService("Players").LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson 13 16 UIS.MouseIconEnabled = false 14 17 15 18 UIS.InputEnded:Connect(function(k) 16 - if k.KeyCode == Enum.KeyCode.M then 19 + if k.KeyCode == Enum.KeyCode.M and UIS:GetFocusedTextBox() == nil and not TXTS_CIF.IsFocused then 17 20 local v = not script.Parent.DummyButton.Modal 18 21 UIS.MouseIconEnabled = v 19 22 script.Parent.CrosshairLabel.Visible = not v
+8
src/StarterPlayer/StarterPlayerScripts/CmdrClient.client.lua
··· 1 + repeat 2 + wait(0.1) 3 + until game:IsLoaded() == true 4 + 5 + local ReplicatedStorage = game:GetService("ReplicatedStorage") 6 + 7 + local Cmdr = require(ReplicatedStorage:WaitForChild("CmdrClient")) 8 + Cmdr:SetActivationKeys({ Enum.KeyCode.F2 })
+13
wally.lock
··· 1 + # This file is automatically @generated by Wally. 2 + # It is not intended for manual editing. 3 + registry = "test" 4 + 5 + [[package]] 6 + name = "evaera/cmdr" 7 + version = "1.12.0" 8 + dependencies = [] 9 + 10 + [[package]] 11 + name = "ocbwoy3-development-studios/minecraft-roblox" 12 + version = "0.1.0" 13 + dependencies = [["cmdr", "evaera/cmdr@1.12.0"]]
+8
wally.toml
··· 1 + [package] 2 + name = "ocbwoy3-development-studios/minecraft-roblox" 3 + version = "0.1.0" 4 + registry = "https://github.com/UpliftGames/wally-index" 5 + realm = "shared" 6 + 7 + [dependencies] 8 + cmdr = "evaera/cmdr@1.12.0"