Advertisement
AA122294

Skybox

Mar 10th, 2025
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local char = player.Character or player.CharacterAdded:Wait()
  3. local tool
  4.  
  5. for _, v in player:GetDescendants() do
  6. if v.Name == "SyncAPI" then
  7. tool = v.Parent
  8. end
  9. end
  10.  
  11. for _, v in game.ReplicatedStorage:GetDescendants() do
  12. if v.Name == "SyncAPI" then
  13. tool = v.Parent
  14. end
  15. end
  16.  
  17. local remote = tool.SyncAPI.ServerEndpoint
  18.  
  19. function _(args)
  20. remote:InvokeServer(unpack(args))
  21. end
  22.  
  23. function CreatePart(cf, parent)
  24. _( {"CreatePart", "Normal", cf, parent} )
  25. end
  26.  
  27. function SetAnchor(part, state)
  28. _( {"SyncAnchor", { {["Part"] = part, ["Anchored"] = state} }} )
  29. end
  30.  
  31. function AddMesh(part)
  32. _( {"CreateMeshes", { {["Part"] = part} }} )
  33. end
  34.  
  35. function SetMesh(part, meshid)
  36. _( {"SyncMesh", { {["Part"] = part, ["MeshId"] = "rbxassetid://" .. meshid} }} )
  37. end
  38.  
  39. function SetTexture(part, texid)
  40. _( {"SyncMesh", { {["Part"] = part, ["TextureId"] = "rbxassetid://" .. texid} }} )
  41. end
  42.  
  43. function MeshResize(part, size)
  44. _( {"SyncMesh", { {["Part"] = part, ["Scale"] = size} }} )
  45. end
  46.  
  47. function Sky(id)
  48. local hrp = char:WaitForChild("HumanoidRootPart")
  49. local cf = hrp.CFrame
  50. CreatePart(CFrame.new(cf.Position + Vector3.new(0, 6, 0)), workspace)
  51. for _, v in workspace:GetDescendants() do
  52. if v:IsA("BasePart") and v.Position == cf.Position + Vector3.new(0, 6, 0) then
  53. SetAnchor(v, true)
  54. AddMesh(v)
  55. SetMesh(v, "111891702759441")
  56. SetTexture(v, id)
  57. MeshResize(v, Vector3.new(8000, 8000, 8000))
  58. end
  59. end
  60. end
  61.  
  62. Sky("125146100810890")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement