LelXD

My orb

Apr 25th, 2017
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
  2.  
  3. local LocalPlayer = game:GetService("Players").LocalPlayer
  4. local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:wait()
  5.  
  6. local Orb = Instance.new("Part", Character)
  7. Orb.Name = "Orb"
  8. Orb.Shape = Enum.PartType.Ball
  9. Orb.CanCollide = false
  10. Orb.BrickColor = BrickColor.new("Bright green")
  11. Orb.Transparency = 0.25
  12. Orb.Size = Vector3.new(2, 2, 2)
  13. Orb.TopSurface = Enum.SurfaceType.Smooth
  14. Orb.BottomSurface = Enum.SurfaceType.Smooth
  15. function onClicked(playerWhoClicked)
  16.     script.Parent.BrickColor = BrickColor.Random()
  17. end
  18.  
  19. script.Parent.ClickDetector.MouseClick:connect(onClicked)
  20.  
  21. local BodyPosition = Instance.new("BodyPosition", Orb)
  22.  
  23. while wait(0) do
  24.     BodyPosition.Position = Character.Head.CFrame:pointToWorldSpace(Vector3.new(2, 1, 0))
  25. end
Add Comment
Please, Sign In to add comment