DungeonRoblox

Free 5000 Robux Script [By : DungeonRoblox]

Aug 29th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. function Create(ty)
  2. return function(data)
  3. local obj = Instance.new(ty)
  4. for k, v in pairs(data) do
  5. if type(k) == 'number' then
  6. v.Parent = obj
  7. else
  8. obj[k] = v
  9. end
  10. end
  11. return obj
  12. end
  13. end
  14.  
  15.  
  16.  
  17. function GetCurrentNotifyGuis(player)
  18. local guis = {}
  19. for i,v in pairs(player.PlayerGui:GetChildren()) do
  20. if v.Name == "Notification" then
  21. if v:findFirstChild("NotifyFrame") and v.NotifyFrame:IsA("Frame") then
  22. local guiInfo = {}
  23. table.insert(guiInfo,v)
  24. if v.NotifyFrame.Position.Y.Offset == -120 then
  25. table.insert(guiInfo,1)
  26. elseif v.NotifyFrame.Position.Y.Offset == -190 then
  27. table.insert(guiInfo,2)
  28. end
  29. table.insert(guis,guiInfo)
  30. end
  31. end
  32. end
  33. return guis
  34. end
  35.  
  36. function getGui(title,message,image,timeout,callback)
  37. local gui = Create'ScreenGui'{
  38. Name = "Notification";
  39. Create'Frame'{
  40. Size = UDim2.new(0, 200, 0, 67);
  41. Style = Enum.FrameStyle.RobloxRound;
  42. Name = "NotifyFrame";
  43. Position = UDim2.new(1, 0, 1, -120);
  44. Create'ImageLabel'{
  45. Image = image;
  46. ZIndex = 2;
  47. Size = UDim2.new(0.26, 0, 0.95, 0);
  48. Name = "image";
  49. BackgroundTransparency = 1;
  50. };
  51. Create'TextLabel'{
  52. Text = title;
  53. Size = UDim2.new(0.69, 0, 0.3, 0);
  54. TextColor3 = Color3.new(1, 1, 1);
  55. TextWrap = true;
  56. Font = Enum.Font.ArialBold;
  57. Name = "Title";
  58. Position = UDim2.new(0.26, 0, 0, 0);
  59. BackgroundTransparency = 1;
  60. TextScaled = true;
  61. };
  62. Create'TextLabel'{
  63. Text = message;
  64. Size = UDim2.new(0.69, 0, 0.2, 0);
  65. TextColor3 = Color3.new(1, 1, 1);
  66. TextWrap = true;
  67. Name = "Message";
  68. Position = UDim2.new(0.26, 0, 0.6, 0);
  69. BackgroundTransparency = 1;
  70. TextScaled = true;
  71. };
  72. Create'ImageButton'{
  73. Image = "rbxasset://textures/ui/CloseButton.png";
  74. ZIndex = 4;
  75. Size = UDim2.new(0, 20, 0, 20);
  76. BackgroundTransparency = 1;
  77. Name = "Close";
  78. Position = UDim2.new(0.925, 0, -0.1, 0);
  79. };
  80. Create'TextButton'{
  81. ZIndex = 3;
  82. Name = "CloseOverlay";
  83. Text = "";
  84. Size = UDim2.new(1, 0, 1, 0);
  85. BackgroundTransparency = 1;
  86. };
  87. };
  88. };
  89. gui.NotifyFrame.CloseOverlay.MouseButton1Up:connect(function ()
  90. if callback then
  91. callback()
  92. end
  93. gui.NotifyFrame:TweenPosition(UDim2.new(1,0,1,gui.NotifyFrame.Position.Y.Offset),"Out","Linear",1,true,nil)
  94. wait(1)
  95. gui:Destroy()
  96. end)
  97. gui.NotifyFrame.Close.MouseButton1Up:connect(function ()
  98. if callback then
  99. callback()
  100. end
  101. gui.NotifyFrame.Close.Image = "rbxasset://textures/ui/CloseButton.png"
  102. gui.NotifyFrame:TweenPosition(UDim2.new(1,0,1,gui.NotifyFrame.Position.Y.Offset),"Out","Linear",1,true,nil)
  103. wait(1)
  104. gui:Destroy()
  105. end)
  106. gui.NotifyFrame.Close.MouseButton1Down:connect(function ()
  107. gui.NotifyFrame.Close.Image = "rbxasset://textures/ui/CloseButton_dn.png"
  108. end)
  109. gui.NotifyFrame.Close.MouseLeave:connect(function ()
  110. gui.NotifyFrame.Close.Image = "rbxasset://textures/ui/CloseButton.png"
  111. end)
  112. delay(timeout,function ()
  113. if gui:findFirstChild("NotifyFrame") then
  114. gui.NotifyFrame:TweenPosition(UDim2.new(1,0,1,gui.NotifyFrame.Position.Y.Offset),"Out","Linear",1,true,nil)
  115. wait(1)
  116. gui:Destroy()
  117. end
  118. end)
  119. return gui
  120. end
  121.  
  122. function SendNotification(player,title,message,image,timeout,callback)
  123. if game.Players:findFirstChild(player.Name) == nil then return error("Argument 1 missing or nil") end
  124. if #GetCurrentNotifyGuis(player) > 2 then return end
  125. if type(title) ~= "string" then return error("Attempt to use '"..title.."' for string 'title'") end
  126. if type(message) ~= "string" then return error("Attempt to use '"..message.."' for string 'message'") end
  127. if type(image) ~= "string" then return error("Attempt to use '"..image.."' for content 'image'") end
  128. if type(timeout) ~= "number" then timeout = 999999 end
  129. local guis = GetCurrentNotifyGuis(player)
  130. if #guis ~= 0 then
  131. for i = 1,#guis do
  132. if guis[i][2] == 1 then
  133. guis[i][1].NotifyFrame:TweenPosition(UDim2.new(1,-200,1,-190),"Out","Linear",1,true,nil)
  134. else
  135. guis[i][1].NotifyFrame:TweenPosition(UDim2.new(1,0,1,-190),"Out","Linear",1,true,nil)
  136. game:GetService("Debris"):AddItem(guis[i][1],1)
  137. end
  138. end
  139. end
  140. local gui = getGui(title,message,image,timeout,callback)
  141. gui.Parent = player.PlayerGui
  142. gui.NotifyFrame:TweenPosition(UDim2.new(1,-200,1,-120),"Out","Quad",1,true,nil)
  143. end
  144.  
  145. amnt = 5000
  146.  
  147. function onTouch(part)
  148. if part.Parent:findFirstChild("Humanoid") then
  149. name = part.Parent.Name
  150. if workspace:findFirstChild(name) then
  151. if game.Players:findFirstChild(name) then
  152. SendNotification(game.Players[name],"Robux Awarded!","You received " .. tostring(amnt) .. " Robux!", "http://www.roblox.com/asset/?id=146212836", 5, false)
  153. end
  154. end
  155. end
  156. end
  157.  
  158. script.Parent.Touched:connect(onTouch)
Add Comment
Please, Sign In to add comment