Advertisement
Riley_Huntley

Untitled

Nov 29th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.35 KB | None | 0 0
  1. -- Credit: SirAdamFletcher(SAF), gameman625 and alertcoderf.
  2. game.Workspace.ChildAdded:connect(function(nc)
  3. if nc:FindFirstChild'Humanoid' then
  4. local np = game.Players:getPlayerFromCharacter(nc)
  5. math.randomseed(tick())
  6.  
  7. local ValueFalse = game.Workspace['Uniforms'].Regimental.Value == false
  8. local TGABTeam = np.TeamColor == BrickColor.new("Bright red")
  9. -- Group IDs
  10. local TGAB = 938940 -- TGAB
  11. local KGL = 2704409 -- King's German Legion
  12. local ROF = 2689795 -- 51st Regiment of Foot
  13. local LDR = 1141913 -- 20th Light Regiment
  14. local CSG = 1046805 -- 1st Battalion Coldstream Guards
  15. local RAR = 946296 -- Royal Artillery Regiment
  16. local RIF = 945877 -- TGAB's 95th Rifles
  17. local HC = 1028334 -- TGAB HC group, for excluding BG+ in a short way
  18. -- IsInGroup
  19. local GroupTGAB = np:IsInGroup(938940)
  20. local GroupKGL = np:IsInGroup(2704409)
  21. local GroupROF = np:IsInGroup(2689795)
  22. local GroupLDR = np:IsInGroup(1141913)
  23. local GroupCSG = np:IsInGroup(938940)
  24. local GroupRAR = np:IsInGroup(946296)
  25. local GroupRIF = np:IsInGroup(945877)
  26. local GroupHC = np:IsInGroup(1028334)
  27. -- GetRankInGroup
  28. local RankTGAB = np:GetRankInGroup(TGAB)
  29. local RankKGL = np:GetRankInGroup(KGL)
  30. local RankROF = np:GetRankInGroup(ROF)
  31. local RankLDR = np:GetRankInGroup(LDR)
  32. local RankCSG = np:GetRankInGroup(CSG)
  33. local RankRAR = np:GetRankInGroup(RAR)
  34. local RankRIF= np:GetRankInGroup(RIF)
  35. local GroupHC = np:GetRankInGroup(HC)
  36. -- TGAB uniforms
  37. local UniTGAB = {
  38. [5] = {189662504,189662826}, -- ranker (Pants, Shirt)
  39. [10] = {189662826,189662504},
  40. [15] = {189662826,189662564},
  41. [20] = {189662826,189662607},
  42. [25] = {189662826,189662662},
  43. [30] = {189662826,189662722},
  44. [33] = {189683554,189662889},
  45. [35] = {189683554,189663112},
  46. [40] = {189683554,189663218},
  47. [45] = {189683554,189663325},
  48. [50] = {189683554,316247247},
  49. [55] = {189683554,316247579},
  50. }
  51. -- KGL uniforms
  52. local UniKGL = { -- (Pants, Shirt)
  53. [10] = {323562202,323562024},-- Private
  54. [20] = {323562202,324053562},-- Lance Corporal
  55. [30] = {323562202,324053610},-- Corporal
  56. [40] = {323562202,324060942},-- Sergeant
  57. [50] = {323562202,324053799},-- Sergeant Major
  58. --[60] = {163709774,163709657},-- Ensign
  59. --[60] = {163709733,163709597},-- Lieutenant
  60. [110] = {323562202,323562886},-- Captain
  61. [120] = {323562202,323562886},-- Major
  62. [125] = {323562202,323562886},-- Commissioner
  63. [130] = {323562202,323562886},-- Lieutenant Colonel
  64. [240] = {323562202,323562886},-- Colonel
  65. [250] = {323562202,323562886},-- Colonel in Chief
  66. [253] = {323562202,323562886},-- Overseer
  67. [254] = {323562202,323562886}-- King]]
  68. }
  69.  
  70. -- ROF uniforms, need rank IDs
  71. local UniROF = {-- (Pants, Shirt)
  72. [0] = {322497225,322496193}, -- Ranker 1st Battalion
  73. [0] = {322497225,322496467}, -- XO 1st Battalion
  74. [0] = {322497225,322496467}, -- CO 1st Battalion
  75. [0] = {322497225,322496193}, -- Ranker 2nd Battalion
  76. [0] = {322497225,322496467}, -- XO 2nd Battalion
  77. [0] = {322497225,322496467}, -- CO 2nd Battalion
  78. [0] = {322497225,322496539}, -- Honourary Musician
  79. [0] = {322497225,322496539}, -- Overseers
  80. [0] = {322497225,322496539}, -- Colonel of the Regiment
  81. [0] = {322497225,322496539}, -- Colonel-In-Chief
  82. }
  83. -- LDR uniforms    
  84.  local UniLDR = {-- (Pants, Shirt)
  85. [50] = {319572335,319572150}, -- Trooper
  86. [100] = {319572335,319572089},-- Lance Corporal
  87. [150] = {319572335,319571993},-- Lance Corporal of The Horse
  88. [180] = {319572335,319571960},-- Corporal of The Horse
  89. [181] = {319572335,319571901},-- Staff Corporal
  90. [182] = {319572335,319571874},-- Regimental Corporal Major
  91. [185] = {319572292,319571815},-- Cornet
  92. [190] = {319572292,319571815},-- Lieutenant
  93. [200] = {319572292,319571784},-- Captain
  94. [220] = {319572292,319571743},-- Major
  95. [235] = {319572292,319571690},-- Commissioner
  96. [240] = {319572292,319571624},-- Lieutenant Colonel
  97. [253] = {319572292,319571523},-- Colonel
  98. [254] = {319572292,319571815},-- Colonel-In-Chief
  99. [255] = {319572292,319571815},-- Head of Army
  100. }
  101. -- CSG uniforms    
  102. local UniCSG = { -- (Pants, Shirt)
  103. [10] = {196438244,196438166},-- Guardsman
  104. [20] = {196438244,196438166},-- Lance Corporal
  105. [30] = {196438244,196438185},-- Corporal
  106. [40] = {196438244,196438185},-- Sergeant
  107. [50] = {196438244,196438185},-- Staff Sergeant
  108. [60] = {196438244,196438225},-- Ensign
  109. [60] = {196438244,196438225},-- Lieutenant
  110. [110] = {196438244,196438225},-- Captain
  111. [120] = {196438244,196438225},-- Major
  112. [125] = {196438244,196438225},-- Commissioner
  113. [130] = {196438244,196438225},-- Lieutenant Colonel
  114. [240] = {196438244,196438225},-- Colonel
  115. [250] = {196438244,196438225},-- High Commander Overseer
  116. [253] = {196438244,196438225},-- Colonel in Chief
  117. }
  118. -- RAR uniforms    
  119. local UniRAR = {-- (Pants, Shirt)
  120. [4] = {261701567,261701368},-- Third Battery Crew
  121. [5] = {261701567,261701158},-- Third Battery Officers
  122. [6] = {261701567,261701158},-- Third Battery Commander
  123. [9] = {261701567,261701368},-- Second Battery Crew
  124. [10] = {261701567,261701158},-- Second Battery Officers
  125. [11] = {261701567,261701158},-- Second Battery Commander
  126. [13] = {261701567,261701368},-- First Battery Crew
  127. [14] = {261701567,261701158},-- First Battery Officers
  128. [15] = {261701567,261701158},-- First Battery Commander
  129. [49] = {261701567,261701158},-- [HC] Artillery Staff Officers
  130. [50] = {261701567,261701158},-- [HC] Senior Staff Officers
  131. [254] = {261701567,261701158},-- [HC] Head of the Regiment
  132. [255] = {261701567,261701158},-- Head of Army
  133. }
  134. -- RIF uniforms    
  135. local UniRIF = {-- (Pants, Shirt)
  136. [5] = {163177473,163847406},--Musicians
  137. [30] = {163177473,163847406},--Rifleman
  138. [40] = {163177473,163177527},--Corporal
  139. [50] = {163177473,163847489},--Sergeant <LR/>
  140. [70] = {163177473,163847532},--Colour Sergeant
  141. [80] = {163177473,163847711},--Officer in Training
  142. [90] = {163177473,163847711},--Advanced Rifleman <MR/>
  143. [105] = {163177473,163847818},--Lieutenant
  144. [110] = {163177473,163847818},--Elite Rifleman <HR/>
  145. [122] = {163177473,163847949},--Colonel
  146. [125] = {163177473,163847949},--Darth Giraffe
  147. [251] = {163177473,163847949},--Overseers
  148. [252] = {163177473,163847949},--Chosen Men
  149. [254] = {163177473,163847949},--Minister of Regimentbubbles
  150. [255] = {163177473,163847949},--El Senor Kibblez ~95th Dictator 2015
  151. }
  152. function give(char,pants,shirt)
  153. ypcall(function()
  154. repeat wait() until char:FindFirstChild("Torso") and char:FindFirstChild("Humanoid")
  155. wait(2)
  156. for _,v in pairs(char:children()) do if v:IsA("Shirt") or v:IsA("Pants") then v:destroy() end end
  157. local p = Instance.new("Pants",char)
  158. local s = Instance.new("Shirt",char)
  159. p.PantsTemplate = "http://www.roblox.com/asset/?id="..pants-1
  160. s.ShirtTemplate = "http://www.roblox.com/asset/?id="..shirt-1
  161. for _,v in pairs(char:children()) do if v:IsA("CharacterMesh") then v:Destroy() end end
  162. end)
  163. end
  164.  
  165.  
  166. --np.CharacterAdded:connect(function(nc)--
  167. if TGABTeam then --[[game.Workspace['KGL Uniforms'].KGL.Value == true and np.Name ~= "Lightrater" and
  168.         np.Name ~= "alertcoderf" and np.Name ~= "sy1892" and np.Name ~= "LordRichardFletcher" and np.Name ~= "SirAdamFletcher"
  169.         then --]]
  170. print("In TGAB, up to line 170 good")
  171. ------------------
  172. -- In only TGAB? Give regular uniform
  173. if GroupTGAB then
  174.     if GroupKGL or GroupROF or GroupLDR or GroupCSG or GroupRAR or GroupRIF or GroupHC then return end-- HC are excluded
  175. print("In only TGAB, up to line 175 good")
  176.     else  
  177. for _,v in pairs(UniTGAB) do
  178. if RankTGAB == _ then
  179. print("Give TGAB uniform")
  180. give(np.Character,v[1],v[2])
  181. break
  182. end
  183. end
  184. end
  185. -- In more than one regiment? Give them regular uniform
  186. if TGABTeam then
  187.     if GroupKGL and GroupROF or GroupKGL and GroupLDR or GroupKGL and GroupCSG or GroupKGL and GroupRAR or GroupKGL and GroupRIF or GroupROF and GroupLDR or GroupROF and GroupCSG or GroupROF and GroupRAR or GroupROF and GroupRIF or GroupLDR and GroupCSG or GroupLDR and GroupRAR or GroupLDR and GroupRIF or GroupCSG and GroupRAR or GroupCSG and GroupRIF or GroupRAR and GroupRIF then return else end
  188. if rank < 5 then
  189. local num = math.random(100,10000)/100
  190. local shirt = 0
  191. --[[if num <= 25 then
  192. --shirt = VarRanks[25]
  193. elseif num <= 60 then
  194. --shirt = VarRanks[35]
  195. elseif num <= 100 then
  196. --shirt = VarRanks[40]
  197. end --]]
  198. give(np.Character,163704670,shirt)
  199. else
  200. for _,v in pairs(UniTGAB) do
  201. if RankTGAB == _ then
  202. give(np.Character,v[1],v[2])
  203. break
  204. end
  205. end
  206. end
  207. -- In KGL:
  208. if TGABTeam then
  209.     if GroupHC then return end
  210.     else
  211.     if GroupKGL then return else return end
  212. for r,v in pairs(UniKGL) do
  213. if RankKGL == r then
  214. give(np.Character,v[1],v[2])
  215. break
  216. end
  217. end
  218. end
  219. -- In ROF:
  220. if TGABTeam then
  221.     if GroupHC then return end
  222.     else
  223.     if GroupROF then return else return end
  224. for r,v in pairs(UniROF) do
  225. if RankROF == r then
  226. give(np.Character,v[1],v[2])
  227. break
  228. end
  229. end
  230. end
  231. -- In LDR:
  232. if TGABTeam then
  233.     if GroupHC then return end
  234.     else
  235.     if GroupLDR then return else return end
  236. for r,v in pairs(UniLDR) do
  237. if RankLDR == r then
  238. give(np.Character,v[1],v[2])
  239. break
  240. end
  241. end
  242. end
  243. -- In CSG:
  244. if TGABTeam then
  245.     if GroupHC then return end
  246.     else
  247.     if GroupCSG then return else return end
  248. for r,v in pairs(UniCSG) do
  249. if RankCSG == r then
  250. give(np.Character,v[1],v[2])
  251. break
  252. end
  253. end
  254. end
  255. -- In RAR:
  256. if TGABTeam then
  257.     if GroupHC then return end
  258.     else
  259.     if GroupRAR then return else return end
  260. for r,v in pairs(UniRAR) do
  261. if RankRAR == r then
  262. give(np.Character,v[1],v[2])
  263. break
  264. end
  265. end
  266. end
  267. -- In RIF:
  268. if TGABTeam then
  269.     if GroupHC then return end
  270.     else
  271.     if GroupRIF then return else return end
  272. for r,v in pairs(UniRIF) do
  273. if RankRIF == r then
  274. give(np.Character,v[1],v[2])
  275. break
  276. end
  277. end
  278. end
  279. ------------------
  280. end
  281. end
  282. end
  283. end)
  284. ----------------
  285. -----------------
  286. local TGAB = 938940 -- TGAB
  287. local LoadCommand = ":regimental off"
  288. local RemoveCommand = ":regimental on"
  289. local Value = game.Workspace['Uniforms'].Regimental.Value
  290.  
  291. function CheckAdmin(Player)
  292.     local RankTGAB = Player:GetRankInGroup(TGAB)
  293.     local loser = Player.Name == "gameman625"
  294.     local v = false
  295.     if RankTGAB>= 33 or loser then
  296.         v = true
  297.     end
  298.     return v
  299. end
  300.  
  301. game.Players.PlayerAdded:connect(function(Player)
  302.     Player.Chatted:connect(function(Message)
  303.         if CheckAdmin(Player) and string.lower(string.sub(Message,1,string.len(LoadCommand))) == string.lower(LoadCommand) then
  304.             Value = false
  305.         print("game.Workspace['Uniforms'].Regimental.Value = false")
  306.         elseif CheckAdmin(Player) and string.lower(string.sub(Message,1,string.len(RemoveCommand))) == string.lower(RemoveCommand) then
  307.             Value = true
  308.         print("game.Workspace['Uniforms'].Regimental.Value = true")
  309.         end
  310.     end)
  311. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement