Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.57 KB | None | 0 0
  1. --[[
  2.     Just follow along the comments and don't touch anything without the '[x]',
  3.         otherwise, just edit to your liking.
  4.        
  5.     Oh yea, the "Values" should be a free model modulescript named "MainModule" for
  6.         it to work
  7.    
  8.     Works like this:
  9.         "/pic 3" makes a picture with scale 3
  10.         "/pic 3.1415 makes a pictuer wit 3.1415"   
  11.        
  12.         Have fun
  13.         --"cxcharlie/jeff"
  14. --]]
  15.  
  16. local Height = 100 --[x]images should be 100x100 or it will look funny
  17. local Width = 100--[x]
  18. local scale = 2--[x]
  19.  
  20. local StarterCFrame = CFrame.new(30,5,0) -- [x]where it is default
  21. --[x]The O_[?] is how much the billboard can randomly be offset by
  22. local O_x = 10--[x]
  23. local O_y = 0--[x]
  24. local O_z = 10--[x]
  25.  
  26. O_x = math.random(-O_x,O_x)
  27. O_y = math.random(-O_y,O_y)
  28. O_z = math.random(-O_z,O_z)
  29.  
  30. local Chattables = {'player1','yourname','addstuf'}--[x]just make it your name all lowercased
  31. local KeyWords = {'/pic','/picture'} --[x] words to make picture
  32. local Values = require(188722596) --[x] adjust as needed
  33.  
  34. ------------------
  35.  
  36. --local RotationConstant = math.rad(10) -- Amount rotated every step
  37. local RS = game:GetService('RunService')
  38.  
  39. local Pictures = {}
  40.  
  41.  
  42. --coroutine.wrap(function()
  43.     --[[RS.Stepped:connect(function()
  44.     for _,v in next (Pictures) do
  45.         local s = ypcall(function()v.Name = v.Name;end)
  46.         if not s then
  47.             table.remove(Pictures,_)
  48.         else
  49.             ypcall(function()v.BillboardGui.Frame.Rotation = v.BillboardGui.Frame.Rotation + RotationConstant;end)
  50.         end
  51.     end
  52.     end)]]--
  53. --end)()
  54.  
  55. local A = {}
  56.  
  57. function In_Table(t,v)
  58.     for _,val in pairs(t) do if val == t then return true end end
  59.     return false
  60. end
  61.  
  62. function Match(t,s)
  63.     for _,v in pairs(t) do
  64.         if string.sub(s,1,string.len(v)):lower() == v:lower() then
  65.             print'k'
  66.             return true
  67.         end
  68.     end
  69.     return false
  70. end
  71.  
  72. function HandleChat(s)
  73.     if Match(KeyWords,s) then
  74.     local number = s:match("[%d%.]+") or scale
  75.     A.Create(number)
  76.     end
  77. end
  78.  
  79. game:GetService('Players').PlayerAdded:connect(function(p)
  80.     if In_Table(Chattables,p.Name:lower()) then
  81.         p.Chat:Connect(function(c)HandleChat(c)end)
  82.     end
  83. end)
  84.  
  85. for _,v in pairs(game:GetService('Players'):GetPlayers()) do
  86.     if In_Table(Chattables,v.Name:lower()) then
  87.         v.Chat:Connect(function(c)HandleChat(c)end)
  88.     end
  89. end
  90.  
  91. A.Create = function(scale)
  92. local p = Instance.new("Part",workspace)
  93. p.CFrame = StarterCFrame * CFrame.new(O_x,O_y,O_z)
  94. p.Anchored = true
  95. p.Transparency = 1
  96. p.CanCollide = false
  97. local m = Instance.new("BillboardGui")
  98. m.Parent = p
  99. m.Adornee = p
  100. m.Size = UDim2.new(0,Width*scale,0,Height*scale)
  101. m.AlwaysOnTop = true
  102. local masterFrame = Instance.new('Frame',m)
  103. masterFrame.Size = UDim2.new(1,0,1,0)
  104. masterFrame.BackgroundTransparency = 1
  105. i = 0
  106. for x=1,Height do
  107. for y=1,Width do
  108. i=i+1
  109. b = Instance.new("Frame") --- less laggy o3o
  110. b.Size = UDim2.new(0,scale,0,scale)
  111. coroutine.resume(coroutine.create(function()
  112. b.Position = UDim2.new(0,x*scale,0,y*scale) --- pixel movement o3o
  113. b.Parent = masterFrame
  114. b.BorderSizePixel = 0
  115. b.BackgroundColor3 = Color3.new(Values[i][2]/255,Values[i][3]/255,Values[i][4]/255)
  116. --b.Transparency = (Values[i][1]-255)/255 -- if you want transparency (not sure if accurate)
  117. end))
  118. end
  119. wait(0.04)
  120. table.insert(Pictures,p)
  121. end
  122. end
  123.  
  124.  
  125.  
  126. --I removed the below because it was too lggy
  127. --coroutine.wrap(function()
  128.     --[[while wait(5) do
  129.         print(type(Pictures))
  130.     for _,v in next, Pictures do
  131.         local s = ypcall(function()v.Name = v.Name;end)
  132.         if not s then
  133.             table.remove(Pictures,_)
  134.             print'huh'
  135.         else
  136.             v.BillboardGui.Frame.Rotation = v.BillboardGui.Frame.Rotation + RotationConstant
  137.         end
  138.     end
  139.     end
  140. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement