Advertisement
Filipono120

[ROBLOX] Marble Script v1.4

Oct 13th, 2020 (edited)
7,015
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.82 KB | None | 0 0
  1. --/{=| ROBLOX MARBLE SCRIPT |=}\--
  2.  
  3. wait(1 / 60)
  4.  
  5. --  | Thank you guys for 1,000 views! We're appreciating so much!!! ;-)
  6.  
  7. local player = game.Players.LocalPlayer
  8.  
  9. local NetworkAccess = coroutine.create(function()
  10.     settings().Physics.AllowSleep = false
  11.     while true do
  12.         game:GetService('RunService').RenderStepped:Wait()
  13.         for _, players in pairs(game.Players:GetChildren()) do
  14.             if players ~= game.Players.LocalPlayer then
  15.                 players.MaximumSimulationRadius = 0.1
  16.                 players.SimulationRadius = 0
  17.             end
  18.         end
  19.         player.MaximumSimulationRadius = math.pow(math.huge, math.huge)
  20.         player.SimulationRadius = math.huge * math.huge
  21.     end
  22. end)
  23.  
  24. coroutine.resume(NetworkAccess)
  25.  
  26. --Marble Settings
  27. local MarbleColor = "Institutional white"
  28. local MarbleMaterial = "Glass"
  29.  
  30. --MarblePhysicalSettings
  31. local Speed = 80
  32. local density = .8
  33. local friction = .1
  34. local elasticity = 1
  35.  
  36. local AutoRun = false --This script will run automatically on respawn
  37.  
  38. --Functions
  39. local function Script()
  40.     local function Weld(Part0, Part1, Parent)
  41.         local Weld = Instance.new("Weld", Parent)
  42.         Weld.Part0 = Part0
  43.         Weld.Part1 = Part1
  44.     end
  45.    
  46.     local function PlatformStand(bool)
  47.         game.Players.LocalPlayer.Character.Humanoid.PlatformStand = bool
  48.     end
  49.    
  50.     --Player Variables
  51.     wait(2.5)
  52.     local player = game.Players.LocalPlayer
  53.     local char = player.Character
  54.     local HRP = char["HumanoidRootPart"]
  55.    
  56.     local jump = false
  57.    
  58.     --Instances
  59.     local Marble = Instance.new("Part", char)
  60.     Marble.Name = "Marble"
  61.     Marble.TopSurface = Enum.SurfaceType.Smooth
  62.     Marble.BottomSurface = Enum.SurfaceType.Smooth
  63.     Marble.BrickColor = BrickColor.new(MarbleColor)
  64.     Marble.Material = MarbleMaterial
  65.     Marble.Transparency = 0.5
  66.     Marble.Size = Vector3.new(6.4, 6.4, 6.4)
  67.     Marble.Shape = Enum.PartType.Ball
  68.     Marble.FormFactor = Enum.FormFactor.Custom
  69.     local BodyForce = Instance.new("BodyVelocity", Marble)
  70.    
  71.     --PlatformStanding
  72.    
  73.     PlatformStand(true)
  74.    
  75.     --Welding
  76.     Marble.Position = char.HumanoidRootPart.Position
  77.     Marble.CustomPhysicalProperties = PhysicalProperties.new(density, friction, elasticity)
  78.     Weld(char.HumanoidRootPart, Marble, char.HumanoidRootPart)
  79.    
  80.     --Detect if player is dead
  81.     char.Humanoid.Died:Connect(function()
  82.         BodyForce:Destroy()
  83.         Marble:Destroy()
  84.         script:Destroy()
  85.     end)
  86.    
  87.     char.Humanoid.Seated:Connect(function()
  88.         PlatformStand(true)
  89.     end)
  90.    
  91.     --BodyForcing
  92.     game:GetService("RunService").RenderStepped:Connect(function()
  93.         BodyForce.MaxForce = Vector3.new(11000, 0, 11000)
  94.         BodyForce.P = 100000000
  95.         BodyForce.Velocity = Vector3.new(char.Humanoid.MoveDirection.X * Speed, 0, char.Humanoid.MoveDirection.Z * Speed)
  96.         Marble.Orientation = Vector3.new(Marble.Orientation.X, 0, Marble.Orientation.Z)
  97.     end)
  98. end
  99.  
  100. Script()
  101.  
  102. game.Players.LocalPlayer.CharacterAdded:Connect(function()
  103.     if AutoRun then
  104.         Script()
  105.     end
  106. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement