50 lines
1015 B
Lua
50 lines
1015 B
Lua
return {
|
|
Name = "resyncchunk",
|
|
Aliases = {"resyncc"},
|
|
Description = "Resync a chunk (and optional radius) for a player.",
|
|
Group = "Debug",
|
|
Args = {
|
|
{
|
|
Type = "player",
|
|
Name = "player",
|
|
Description = "Player to resync"
|
|
},
|
|
{
|
|
Type = "integer",
|
|
Name = "cx",
|
|
Description = "Chunk X"
|
|
},
|
|
{
|
|
Type = "integer",
|
|
Name = "cy",
|
|
Description = "Chunk Y"
|
|
},
|
|
{
|
|
Type = "integer",
|
|
Name = "cz",
|
|
Description = "Chunk Z"
|
|
},
|
|
{
|
|
Type = "integer",
|
|
Name = "radius",
|
|
Description = "Radius around the chunk",
|
|
Optional = true,
|
|
Default = 0
|
|
}
|
|
},
|
|
Run = function(context, player, cx, cy, cz, radius)
|
|
local tickRemote = game:GetService("ReplicatedStorage"):WaitForChild("Tick")
|
|
local r = radius or 0
|
|
local count = 0
|
|
for y = -r, r do
|
|
for x = -r, r do
|
|
for z = -r, r do
|
|
tickRemote:FireClient(player, "C_R", cx + x, cy + y, cz + z, 0, 0, 0, 0)
|
|
count += 1
|
|
end
|
|
end
|
|
end
|
|
return ("Resync sent to %s (%d chunks)"):format(player.Name, count)
|
|
end
|
|
}
|