Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local char = player.Character or player.CharacterAdded:Wait()
- local tool
- for i, v in player:GetDescendants() do
- if v.Name == "SyncAPI" then
- tool = v.Parent
- end
- end
- for i, v in game.ReplicatedStorage:GetDescendants() do
- if v.Name == "SyncAPI" then
- tool = v.Parent
- end
- end
- remote = tool.SyncAPI.ServerEndpoint
- function _(args)
- remote:InvokeServer(unpack(args))
- end
- function CreatePart(cf, parent)
- local args = {
- [1] = "CreatePart",
- [2] = "Normal",
- [3] = cf,
- [4] = parent
- }
- _(args)
- end
- function AddMesh(part)
- local args = {
- [1] = "CreateMeshes",
- [2] = {
- [1] = {
- ["Part"] = part
- }
- }
- }
- _(args)
- end
- function SetMesh(part, meshid)
- local args = {
- [1] = "SyncMesh",
- [2] = {
- [1] = {
- ["Part"] = part,
- ["MeshId"] = "rbxassetid://" .. meshid
- }
- }
- }
- _(args)
- end
- function SetTexture(part, texid)
- local args = {
- [1] = "SyncMesh",
- [2] = {
- [1] = {
- ["Part"] = part,
- ["TextureId"] = "rbxassetid://" .. texid
- }
- }
- }
- _(args)
- end
- function MeshResize(part, size)
- local args = {
- [1] = "SyncMesh",
- [2] = {
- [1] = {
- ["Part"] = part,
- ["Scale"] = size
- }
- }
- }
- _(args)
- end
- function SetName(part, name)
- local args = {
- [1] = "SetName",
- [2] = {
- [1] = part
- },
- [3] = name
- }
- _(args)
- end
- -- Спавн и настройка скайбокса
- function Sky(id)
- local e = char.HumanoidRootPart.Position.X
- local f = char.HumanoidRootPart.Position.Y
- local g = char.HumanoidRootPart.Position.Z
- -- Создаем Part выше игрока
- CreatePart(CFrame.new(e, f + 20, g), workspace)
- task.wait(0.2) -- Ждем немного, чтобы Part точно создался
- for _, v in workspace:GetDescendants() do
- if v:IsA("BasePart") and not v:IsDescendantOf(char) and v.Name ~= "HumanoidRootPart" then
- if math.abs(v.Position.X - e) < 2 and math.abs(v.Position.Z - g) < 2 then
- SetName(v, "SkyPart") -- Помечаем, чтобы избежать случайных изменений других объектов
- AddMesh(v)
- SetMesh(v, "1527559")
- SetTexture(v, id)
- MeshResize(v, Vector3.new(-3000, -3000, -3000))
- end
- end
- end
- end
- Sky("111208964753144")
Advertisement
Add Comment
Please, Sign In to add comment