StefanBoss

Untitled

Apr 17th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. sizex = script.Base.Size.x/2
  2. offx = script.Base.Position.x
  3. sizez = script.Base.Size.z/2
  4. offz = script.Base.Position.z
  5. sizey = script.Base.Position.y+50
  6. tix = script.TIX:clone()
  7. bux = script.BUX:clone()
  8. script.TIX:remove()
  9. script.BUX:remove()
  10.  
  11. game.Players.ChildAdded:connect(function(player)
  12. local stats = Instance.new("IntValue")
  13. stats.Name = "leaderstats"
  14. local c = Instance.new("IntValue")
  15. c.Name = "Cash"
  16. c.Value = 0
  17. c.Parent = stats
  18. stats.Parent = player
  19. end)
  20.  
  21. function Collide(part, val)
  22. part.Touched:connect(function(hit)
  23. if not hit.Parent then return end
  24. p = game.Players:GetPlayerFromCharacter(hit.Parent)
  25. if not p then return end
  26. p.leaderstats.Cash.Value = p.leaderstats.Cash.Value+val
  27. part:remove()
  28. end)
  29. wait(15)
  30. part:remove()
  31. end
  32.  
  33. script.Flip.Changed:connect(function()
  34. r = math.random(1,10)
  35. if r == 10 then
  36. vall = 10
  37. t = bux:clone()
  38. else
  39. vall = 1
  40. t = tix:clone()
  41. end
  42. t.Parent = game.Workspace
  43. t.Position = Vector3.new(math.random(-1*sizex, sizex)+offx, sizey, math.random(-1*sizez, sizez)+offz)
  44. t.Velocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10))
  45. t.RotVelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10))
  46. Collide(t, vall)
  47. end)
  48.  
  49. while true do
  50. script.Flip.Value = not script.Flip.Value
  51. wait()
  52. end
Advertisement
Add Comment
Please, Sign In to add comment