Advertisement
HenloMyDude

trashy uno by me

Jan 1st, 2020
4,145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.08 KB | None | 0 0
  1.  
  2. --by youngmacka123--
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. local RealPlayer = Player
  7. do print("hi")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  8.  
  9. plr = owner
  10. plrgui = plr.PlayerGui
  11.  
  12. local gui = Instance.new("ScreenGui", plrgui)
  13. gui.Name = "uno"
  14.  
  15. local duno = Instance.new("ImageButton")
  16. duno.Size = UDim2.new(0, 100, 0, 175)
  17. duno.AnchorPoint = Vector2.new(0.5, 0.75)
  18. duno.Position = UDim2.new(0.5, 0, 0.75, 0)
  19. duno.BorderSizePixel = 0
  20. duno.BackgroundTransparency = 0
  21.  
  22. local h
  23.  
  24. function color(c)
  25. return BrickColor.new(c).Color
  26. end
  27.  
  28. function checkvalue(v)
  29. return v.Value
  30. end
  31.  
  32. function setvalue(p, n, v)
  33. local val = Instance.new("NumberValue", p)
  34. val.Name = n
  35. val.Value = v
  36. return val
  37. end
  38.  
  39. function noturn(model)
  40. local val = setvalue(model, "no turn", 0)
  41. return val
  42. end
  43.  
  44. local playing = false
  45. local plr1 = nil
  46. local plr2 = nil
  47.  
  48. function generatecards(ui, brick, target2)
  49. local last = nil
  50. local amount = 0
  51. local canwin = false
  52. local cards = setvalue(ui, "cards", 6)
  53. local unobutton = Instance.new("TextButton", ui)
  54. unobutton.Text = "UNO"
  55. unobutton.BackgroundTransparency = 0.5
  56. unobutton.Size = UDim2.new(0, 175, 0, 80)
  57. unobutton.AnchorPoint = Vector2.new(0, 0.5)
  58. unobutton.Position = UDim2.new(0, 0, 0.5, 0)
  59. unobutton.MouseButton1Click:connect(function()
  60. if amount < 2 then
  61. canwin = true
  62. end
  63. end)
  64. local pickup = Instance.new("TextButton", ui)
  65. pickup.Text = "Pick up"
  66. pickup.BackgroundTransparency = 0.5
  67. pickup.Size = UDim2.new(0, 175, 0, 80)
  68. pickup.AnchorPoint = Vector2.new(0, 0.25)
  69. pickup.Position = UDim2.new(0, 0, 0.25, 0)
  70. pickup.MouseButton1Click:connect(function()
  71. if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
  72. amount = amount + 1
  73. local newlast = nil
  74. last = nil
  75. for i,v in pairs (ui:children()) do
  76. if v:IsA("ImageButton") then
  77. if last == nil then
  78. v.AnchorPoint = duno.AnchorPoint + Vector2.new(0.025, 0)
  79. v.Position = duno.Position + UDim2.new(0.025, 0)
  80. v.Rotation = -25
  81. newlast = v
  82. last = v
  83. else
  84. v.AnchorPoint = last.AnchorPoint + Vector2.new(0.035, -0)
  85. v.Position = newlast.Position + UDim2.new(0.035, 0, -0, 0)
  86. v.Rotation = newlast.Rotation + 9.75
  87. newlast = v
  88. last = v
  89. end
  90. end
  91. end
  92. local card = duno:Clone()
  93. card.Parent = ui
  94. card.AnchorPoint = newlast.AnchorPoint + Vector2.new(0.035, -0) or duno.AnchorPoint - Vector2.new(0.085, 0)
  95. card.Position = newlast.Position + UDim2.new(0.035, 0, -0, 0) or card.Position - UDim2.new(0.085, 0)
  96. card.Rotation = newlast.Rotation + 9.75 or 0
  97. local rad = math.random(0, 9)
  98. local number = Instance.new("NumberValue", card)
  99. number.Value = rad
  100. local value = setvalue(card, "value", rad)
  101.  
  102. if rad == 0 then
  103. card.Image = "http://www.roblox.com/asset/?id=31088273"
  104. elseif rad == 1 then
  105. card.Image = "http://www.roblox.com/asset/?id=31088284"
  106. elseif rad == 2 then
  107. card.Image = "http://www.roblox.com/asset/?id=31088292"
  108. elseif rad == 3 then
  109. card.Image = "http://www.roblox.com/asset/?id=31088300"
  110. elseif rad == 4 then
  111. card.Image = "http://www.roblox.com/asset/?id=31088309"
  112. elseif rad == 5 then
  113. card.Image = "http://www.roblox.com/asset/?id=31088316"
  114. elseif rad == 6 then
  115. card.Image = "http://www.roblox.com/asset/?id=31088337"
  116. elseif rad == 7 then
  117. card.Image = "http://www.roblox.com/asset/?id=31088351"
  118. elseif rad == 8 then
  119. card.Image = "http://www.roblox.com/asset/?id=31088361"
  120. elseif rad == 9 then
  121. card.Image = "http://www.roblox.com/asset/?id=31088371"
  122. end
  123. local rad2 = math.random(1, 4)
  124. if rad2 == 1 then
  125. card.BackgroundColor3 = color("Bright red")
  126. end
  127. if rad2 == 2 then
  128. card.BackgroundColor3 = color("Bright blue")
  129. end
  130. if rad2 == 3 then
  131. card.BackgroundColor3 = color("Bright green")
  132. end
  133. if rad2 == 4 then
  134. card.BackgroundColor3 = color("Bright yellow")
  135. end
  136. last = card
  137.  
  138. card.MouseButton1Click:connect(function()
  139. if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
  140. if brick.value.Value == card.value.Value then
  141. local turnie = noturn(ui.Parent.Parent.Character)
  142. game.Debris:AddItem(turnie, 1)
  143. amount = amount - 1
  144. brick.value.Value = card.value.Value
  145. brick.Color = card.BackgroundColor3
  146. brick.card.Texture = card.Image
  147. card:remove()
  148. if canwin == true then
  149. playing = false
  150. ui:remove()
  151. plr1 = nil
  152. plr2 = nil
  153. end
  154. elseif brick.BrickColor.Name == BrickColor.new(card.BackgroundColor3).Name then
  155. local turnie = noturn(ui.Parent.Parent.Character)
  156. game.Debris:AddItem(turnie, 1)
  157. amount = amount - 1
  158. brick.value.Value = card.value.Value
  159. brick.Color = card.BackgroundColor3
  160. brick.card.Texture = card.Image
  161. card:remove()
  162. if canwin == true then
  163. playing = false
  164. ui:remove()
  165. plr1 = nil
  166. plr2 = nil
  167. end
  168. end
  169. end
  170. end)
  171.  
  172. end
  173.  
  174. end)
  175. for i = 1,6 do
  176. amount = amount + 1
  177. if last == nil then
  178. local card = duno:Clone()
  179. card.Parent = ui
  180. card.AnchorPoint = duno.AnchorPoint - Vector2.new(0.085, 0)
  181. card.Position = card.Position - UDim2.new(0.085, 0)
  182. card.Rotation = -25
  183. last = card
  184. local rad = math.random(0, 9)
  185. local number = Instance.new("NumberValue", card)
  186. number.Value = rad
  187. local value = setvalue(card, "value", rad)
  188. card.MouseButton1Click:connect(function()
  189. if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
  190. if brick.value.Value == card.value.Value then
  191. local turnie = noturn(ui.Parent.Parent.Character)
  192. game.Debris:AddItem(turnie, 1)
  193. amount = amount - 1
  194. brick.value.Value = card.value.Value
  195. brick.Color = card.BackgroundColor3
  196. brick.card.Texture = card.Image
  197. card:remove()
  198. if canwin == true then
  199. playing = false
  200. ui:remove()
  201. plr1 = nil
  202. plr2 = nil
  203. end
  204. elseif brick.BrickColor.Name == BrickColor.new(card.BackgroundColor3).Name then
  205. local turnie = noturn(ui.Parent.Parent.Character)
  206. game.Debris:AddItem(turnie, 1)
  207. amount = amount - 1
  208. brick.value.Value = card.value.Value
  209. brick.Color = card.BackgroundColor3
  210. brick.card.Texture = card.Image
  211. card:remove()
  212. if canwin == true then
  213. playing = false
  214. ui:remove()
  215. plr1 = nil
  216. plr2 = nil
  217. end
  218. end
  219. end
  220. end)
  221. if rad == 0 then
  222. card.Image = "http://www.roblox.com/asset/?id=31088273"
  223. elseif rad == 1 then
  224. card.Image = "http://www.roblox.com/asset/?id=31088284"
  225. elseif rad == 2 then
  226. card.Image = "http://www.roblox.com/asset/?id=31088292"
  227. elseif rad == 3 then
  228. card.Image = "http://www.roblox.com/asset/?id=31088300"
  229. elseif rad == 4 then
  230. card.Image = "http://www.roblox.com/asset/?id=31088309"
  231. elseif rad == 5 then
  232. card.Image = "http://www.roblox.com/asset/?id=31088316"
  233. elseif rad == 6 then
  234. card.Image = "http://www.roblox.com/asset/?id=31088337"
  235. elseif rad == 7 then
  236. card.Image = "http://www.roblox.com/asset/?id=31088351"
  237. elseif rad == 8 then
  238. card.Image = "http://www.roblox.com/asset/?id=31088361"
  239. elseif rad == 9 then
  240. card.Image = "http://www.roblox.com/asset/?id=31088371"
  241. end
  242. local rad2 = math.random(1, 4)
  243. if rad2 == 1 then
  244. card.BackgroundColor3 = color("Bright red")
  245. end
  246. if rad2 == 2 then
  247. card.BackgroundColor3 = color("Bright blue")
  248. end
  249. if rad2 == 3 then
  250. card.BackgroundColor3 = color("Bright green")
  251. end
  252. if rad2 == 4 then
  253. card.BackgroundColor3 = color("Bright yellow")
  254. end
  255. else
  256. local card = duno:Clone()
  257. card.Parent = ui
  258. card.AnchorPoint = last.AnchorPoint + Vector2.new(0.035, -0)
  259. card.Position = last.Position + UDim2.new(0.035, 0, -0, 0)
  260. card.Rotation = last.Rotation + 9.75
  261. last = card
  262. local rad = math.random(0, 9)
  263. local number = Instance.new("NumberValue", card)
  264. number.Value = rad
  265. local value = setvalue(card, "value", rad)
  266. card.MouseButton1Click:connect(function()
  267. if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
  268. if brick.value.Value == card.value.Value then
  269. local turnie = noturn(ui.Parent.Parent.Character)
  270. game.Debris:AddItem(turnie, 1)
  271. amount = amount - 1
  272. brick.value.Value = card.value.Value
  273. brick.Color = card.BackgroundColor3
  274. brick.card.Texture = card.Image
  275. card:remove()
  276. if canwin == true then
  277. playing = false
  278. end
  279. elseif brick.BrickColor.Name == BrickColor.new(card.BackgroundColor3).Name then
  280. local turnie = noturn(ui.Parent.Parent.Character)
  281. game.Debris:AddItem(turnie, 1)
  282. amount = amount - 1
  283. brick.value.Value = card.value.Value
  284. brick.Color = card.BackgroundColor3
  285. brick.card.Texture = card.Image
  286. card:remove()
  287. if canwin == true then
  288. playing = false
  289. end
  290. end
  291. end
  292. end)
  293. if rad == 0 then
  294. card.Image = "http://www.roblox.com/asset/?id=31088273"
  295. elseif rad == 1 then
  296. card.Image = "http://www.roblox.com/asset/?id=31088284"
  297. elseif rad == 2 then
  298. card.Image = "http://www.roblox.com/asset/?id=31088292"
  299. elseif rad == 3 then
  300. card.Image = "http://www.roblox.com/asset/?id=31088300"
  301. elseif rad == 4 then
  302. card.Image = "http://www.roblox.com/asset/?id=31088309"
  303. elseif rad == 5 then
  304. card.Image = "http://www.roblox.com/asset/?id=31088316"
  305. elseif rad == 6 then
  306. card.Image = "http://www.roblox.com/asset/?id=31088337"
  307. elseif rad == 7 then
  308. card.Image = "http://www.roblox.com/asset/?id=31088351"
  309. elseif rad == 8 then
  310. card.Image = "http://www.roblox.com/asset/?id=31088361"
  311. elseif rad == 9 then
  312. card.Image = "http://www.roblox.com/asset/?id=31088371"
  313. end
  314. local rad2 = math.random(1, 4)
  315. if rad2 == 1 then
  316. card.BackgroundColor3 = color("Bright red")
  317. end
  318. if rad2 == 2 then
  319. card.BackgroundColor3 = color("Bright blue")
  320. end
  321. if rad2 == 3 then
  322. card.BackgroundColor3 = color("Bright green")
  323. end
  324. if rad2 == 4 then
  325. card.BackgroundColor3 = color("Bright yellow")
  326. end
  327. end
  328. end
  329. end
  330.  
  331. function playagainst(target)
  332. local card = Instance.new("Part", script)
  333. card.Name = "currentcard"
  334. card.Size = Vector3.new(1, 0.05, 2)
  335. card.Anchored = true
  336. card.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0, -1.99, -1)
  337. local decal = Instance.new("Decal", card)
  338. decal.Face = "Top"
  339. decal.Name = "card"
  340. local rad = math.random(0, 9)
  341. local val = setvalue(card, "value", rad)
  342. if rad == 0 then
  343. decal.Texture = "http://www.roblox.com/asset/?id=31088273"
  344. elseif rad == 1 then
  345. decal.Texture = "http://www.roblox.com/asset/?id=31088284"
  346. elseif rad == 2 then
  347. decal.Texture = "http://www.roblox.com/asset/?id=31088292"
  348. elseif rad == 3 then
  349. decal.Texture = "http://www.roblox.com/asset/?id=31088300"
  350. elseif rad == 4 then
  351. decal.Texture = "http://www.roblox.com/asset/?id=31088309"
  352. elseif rad == 5 then
  353. decal.Texture = "http://www.roblox.com/asset/?id=31088316"
  354. elseif rad == 6 then
  355. decal.Texture = "http://www.roblox.com/asset/?id=31088337"
  356. elseif rad == 7 then
  357. decal.Texture = "http://www.roblox.com/asset/?id=31088351"
  358. elseif rad == 8 then
  359. decal.Texture = "http://www.roblox.com/asset/?id=31088361"
  360. elseif rad == 9 then
  361. decal.Texture = "http://www.roblox.com/asset/?id=31088371"
  362. end
  363. local rad2 = math.random(1, 4)
  364. if rad2 == 1 then
  365. card.Color = color("Bright red")
  366. end
  367. if rad2 == 2 then
  368. card.Color = color("Bright blue")
  369. end
  370. if rad2 == 3 then
  371. card.Color = color("Bright green")
  372. end
  373. if rad2 == 4 then
  374. card.Color = color("Bright yellow")
  375. end
  376. local rad = math.random(0, 9)
  377. local gameover = false
  378. local theirgui = Instance.new("ScreenGui")
  379. local other = game:GetService("Players"):GetPlayerFromCharacter(target)
  380. if other then
  381. theirgui.Parent = other.PlayerGui
  382. generatecards(gui, card, target)
  383. generatecards(theirgui, card, plr)
  384. playing = true
  385. end
  386. end
  387.  
  388. function playagainst3(target, target2)
  389. local card = Instance.new("Part", script)
  390. card.Name = "currentcard"
  391. card.Size = Vector3.new(1, 0.05, 2)
  392. card.Anchored = true
  393. card.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0, -1.99, -1)
  394. local decal = Instance.new("Decal", card)
  395. decal.Face = "Top"
  396. decal.Name = "card"
  397. local rad = math.random(0, 9)
  398. local val = setvalue(card, "value", rad)
  399. if rad == 0 then
  400. decal.Texture = "http://www.roblox.com/asset/?id=31088273"
  401. elseif rad == 1 then
  402. decal.Texture = "http://www.roblox.com/asset/?id=31088284"
  403. elseif rad == 2 then
  404. decal.Texture = "http://www.roblox.com/asset/?id=31088292"
  405. elseif rad == 3 then
  406. decal.Texture = "http://www.roblox.com/asset/?id=31088300"
  407. elseif rad == 4 then
  408. decal.Texture = "http://www.roblox.com/asset/?id=31088309"
  409. elseif rad == 5 then
  410. decal.Texture = "http://www.roblox.com/asset/?id=31088316"
  411. elseif rad == 6 then
  412. decal.Texture = "http://www.roblox.com/asset/?id=31088337"
  413. elseif rad == 7 then
  414. decal.Texture = "http://www.roblox.com/asset/?id=31088351"
  415. elseif rad == 8 then
  416. decal.Texture = "http://www.roblox.com/asset/?id=31088361"
  417. elseif rad == 9 then
  418. decal.Texture = "http://www.roblox.com/asset/?id=31088371"
  419. end
  420. local rad2 = math.random(1, 4)
  421. if rad2 == 1 then
  422. card.Color = color("Bright red")
  423. end
  424. if rad2 == 2 then
  425. card.Color = color("Bright blue")
  426. end
  427. if rad2 == 3 then
  428. card.Color = color("Bright green")
  429. end
  430. if rad2 == 4 then
  431. card.Color = color("Bright yellow")
  432. end
  433. local rad = math.random(0, 9)
  434. local gameover = false
  435. local theirgui = Instance.new("ScreenGui")
  436. local other = game:GetService("Players"):GetPlayerFromCharacter(target)
  437. local other2 = game:GetService("Players"):GetPlayerFromCharacter(target2)
  438. if other then
  439. theirgui.Parent = other.PlayerGui
  440. generatecards(gui, card, target)
  441. generatecards(theirgui, card, plr)
  442. playing = true
  443. end
  444. if other2 then
  445. theirgui.Parent = other.PlayerGui
  446. generatecards(theirgui, card, plr)
  447. playing = true
  448. end
  449. end
  450.  
  451. players = 0
  452. mouse = plr:GetMouse()
  453. mouse.Button1Down:connect(function()
  454. if mouse.Target and playing == false then
  455. if mouse.Target.Parent then
  456. playagainst(mouse.Target.Parent)
  457. end
  458. end
  459. end)
  460. mouse.KeyDown:connect(function(key)
  461. if key == "e" then
  462. if players < 3 then
  463. if plr1 == nil and plr2 == nil then
  464. if mouse.Target and playing == false then
  465. if mouse.Target.Parent then
  466. plr1 = mouse.Target.Parent
  467. end
  468. end
  469. elseif plr1 ~= nil and plr2 == nil then
  470. if mouse.Target and playing == false then
  471. if mouse.Target.Parent then
  472. plr2 = mouse.Target.Parent
  473. end
  474. end
  475. elseif plr1 == nil and plr2 ~= nil then
  476. if mouse.Target and playing == false then
  477. if mouse.Target.Parent then
  478. plr1 = mouse.Target.Parent
  479. end
  480. end
  481. elseif plr1 ~= nil and plr2 ~= nil then
  482. playagainst3(plr1, plr2)
  483. end
  484. end
  485. end
  486. end)
  487.  
  488. --generatecards(gui)
  489. warn'by youngmacka123 also if you wanna make a game off this i would appreciate atleast some credit for my trashy uno script'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement