Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --by youngmacka123--
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- 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
- plr = owner
- plrgui = plr.PlayerGui
- local gui = Instance.new("ScreenGui", plrgui)
- gui.Name = "uno"
- local duno = Instance.new("ImageButton")
- duno.Size = UDim2.new(0, 100, 0, 175)
- duno.AnchorPoint = Vector2.new(0.5, 0.75)
- duno.Position = UDim2.new(0.5, 0, 0.75, 0)
- duno.BorderSizePixel = 0
- duno.BackgroundTransparency = 0
- local h
- function color(c)
- return BrickColor.new(c).Color
- end
- function checkvalue(v)
- return v.Value
- end
- function setvalue(p, n, v)
- local val = Instance.new("NumberValue", p)
- val.Name = n
- val.Value = v
- return val
- end
- function noturn(model)
- local val = setvalue(model, "no turn", 0)
- return val
- end
- local playing = false
- local plr1 = nil
- local plr2 = nil
- function generatecards(ui, brick, target2)
- local last = nil
- local amount = 0
- local canwin = false
- local cards = setvalue(ui, "cards", 6)
- local unobutton = Instance.new("TextButton", ui)
- unobutton.Text = "UNO"
- unobutton.BackgroundTransparency = 0.5
- unobutton.Size = UDim2.new(0, 175, 0, 80)
- unobutton.AnchorPoint = Vector2.new(0, 0.5)
- unobutton.Position = UDim2.new(0, 0, 0.5, 0)
- unobutton.MouseButton1Click:connect(function()
- if amount < 2 then
- canwin = true
- end
- end)
- local pickup = Instance.new("TextButton", ui)
- pickup.Text = "Pick up"
- pickup.BackgroundTransparency = 0.5
- pickup.Size = UDim2.new(0, 175, 0, 80)
- pickup.AnchorPoint = Vector2.new(0, 0.25)
- pickup.Position = UDim2.new(0, 0, 0.25, 0)
- pickup.MouseButton1Click:connect(function()
- if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
- amount = amount + 1
- local newlast = nil
- last = nil
- for i,v in pairs (ui:children()) do
- if v:IsA("ImageButton") then
- if last == nil then
- v.AnchorPoint = duno.AnchorPoint + Vector2.new(0.025, 0)
- v.Position = duno.Position + UDim2.new(0.025, 0)
- v.Rotation = -25
- newlast = v
- last = v
- else
- v.AnchorPoint = last.AnchorPoint + Vector2.new(0.035, -0)
- v.Position = newlast.Position + UDim2.new(0.035, 0, -0, 0)
- v.Rotation = newlast.Rotation + 9.75
- newlast = v
- last = v
- end
- end
- end
- local card = duno:Clone()
- card.Parent = ui
- card.AnchorPoint = newlast.AnchorPoint + Vector2.new(0.035, -0) or duno.AnchorPoint - Vector2.new(0.085, 0)
- card.Position = newlast.Position + UDim2.new(0.035, 0, -0, 0) or card.Position - UDim2.new(0.085, 0)
- card.Rotation = newlast.Rotation + 9.75 or 0
- local rad = math.random(0, 9)
- local number = Instance.new("NumberValue", card)
- number.Value = rad
- local value = setvalue(card, "value", rad)
- if rad == 0 then
- card.Image = "http://www.roblox.com/asset/?id=31088273"
- elseif rad == 1 then
- card.Image = "http://www.roblox.com/asset/?id=31088284"
- elseif rad == 2 then
- card.Image = "http://www.roblox.com/asset/?id=31088292"
- elseif rad == 3 then
- card.Image = "http://www.roblox.com/asset/?id=31088300"
- elseif rad == 4 then
- card.Image = "http://www.roblox.com/asset/?id=31088309"
- elseif rad == 5 then
- card.Image = "http://www.roblox.com/asset/?id=31088316"
- elseif rad == 6 then
- card.Image = "http://www.roblox.com/asset/?id=31088337"
- elseif rad == 7 then
- card.Image = "http://www.roblox.com/asset/?id=31088351"
- elseif rad == 8 then
- card.Image = "http://www.roblox.com/asset/?id=31088361"
- elseif rad == 9 then
- card.Image = "http://www.roblox.com/asset/?id=31088371"
- end
- local rad2 = math.random(1, 4)
- if rad2 == 1 then
- card.BackgroundColor3 = color("Bright red")
- end
- if rad2 == 2 then
- card.BackgroundColor3 = color("Bright blue")
- end
- if rad2 == 3 then
- card.BackgroundColor3 = color("Bright green")
- end
- if rad2 == 4 then
- card.BackgroundColor3 = color("Bright yellow")
- end
- last = card
- card.MouseButton1Click:connect(function()
- if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
- if brick.value.Value == card.value.Value then
- local turnie = noturn(ui.Parent.Parent.Character)
- game.Debris:AddItem(turnie, 1)
- amount = amount - 1
- brick.value.Value = card.value.Value
- brick.Color = card.BackgroundColor3
- brick.card.Texture = card.Image
- card:remove()
- if canwin == true then
- playing = false
- ui:remove()
- plr1 = nil
- plr2 = nil
- end
- elseif brick.BrickColor.Name == BrickColor.new(card.BackgroundColor3).Name then
- local turnie = noturn(ui.Parent.Parent.Character)
- game.Debris:AddItem(turnie, 1)
- amount = amount - 1
- brick.value.Value = card.value.Value
- brick.Color = card.BackgroundColor3
- brick.card.Texture = card.Image
- card:remove()
- if canwin == true then
- playing = false
- ui:remove()
- plr1 = nil
- plr2 = nil
- end
- end
- end
- end)
- end
- end)
- for i = 1,6 do
- amount = amount + 1
- if last == nil then
- local card = duno:Clone()
- card.Parent = ui
- card.AnchorPoint = duno.AnchorPoint - Vector2.new(0.085, 0)
- card.Position = card.Position - UDim2.new(0.085, 0)
- card.Rotation = -25
- last = card
- local rad = math.random(0, 9)
- local number = Instance.new("NumberValue", card)
- number.Value = rad
- local value = setvalue(card, "value", rad)
- card.MouseButton1Click:connect(function()
- if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
- if brick.value.Value == card.value.Value then
- local turnie = noturn(ui.Parent.Parent.Character)
- game.Debris:AddItem(turnie, 1)
- amount = amount - 1
- brick.value.Value = card.value.Value
- brick.Color = card.BackgroundColor3
- brick.card.Texture = card.Image
- card:remove()
- if canwin == true then
- playing = false
- ui:remove()
- plr1 = nil
- plr2 = nil
- end
- elseif brick.BrickColor.Name == BrickColor.new(card.BackgroundColor3).Name then
- local turnie = noturn(ui.Parent.Parent.Character)
- game.Debris:AddItem(turnie, 1)
- amount = amount - 1
- brick.value.Value = card.value.Value
- brick.Color = card.BackgroundColor3
- brick.card.Texture = card.Image
- card:remove()
- if canwin == true then
- playing = false
- ui:remove()
- plr1 = nil
- plr2 = nil
- end
- end
- end
- end)
- if rad == 0 then
- card.Image = "http://www.roblox.com/asset/?id=31088273"
- elseif rad == 1 then
- card.Image = "http://www.roblox.com/asset/?id=31088284"
- elseif rad == 2 then
- card.Image = "http://www.roblox.com/asset/?id=31088292"
- elseif rad == 3 then
- card.Image = "http://www.roblox.com/asset/?id=31088300"
- elseif rad == 4 then
- card.Image = "http://www.roblox.com/asset/?id=31088309"
- elseif rad == 5 then
- card.Image = "http://www.roblox.com/asset/?id=31088316"
- elseif rad == 6 then
- card.Image = "http://www.roblox.com/asset/?id=31088337"
- elseif rad == 7 then
- card.Image = "http://www.roblox.com/asset/?id=31088351"
- elseif rad == 8 then
- card.Image = "http://www.roblox.com/asset/?id=31088361"
- elseif rad == 9 then
- card.Image = "http://www.roblox.com/asset/?id=31088371"
- end
- local rad2 = math.random(1, 4)
- if rad2 == 1 then
- card.BackgroundColor3 = color("Bright red")
- end
- if rad2 == 2 then
- card.BackgroundColor3 = color("Bright blue")
- end
- if rad2 == 3 then
- card.BackgroundColor3 = color("Bright green")
- end
- if rad2 == 4 then
- card.BackgroundColor3 = color("Bright yellow")
- end
- else
- local card = duno:Clone()
- card.Parent = ui
- card.AnchorPoint = last.AnchorPoint + Vector2.new(0.035, -0)
- card.Position = last.Position + UDim2.new(0.035, 0, -0, 0)
- card.Rotation = last.Rotation + 9.75
- last = card
- local rad = math.random(0, 9)
- local number = Instance.new("NumberValue", card)
- number.Value = rad
- local value = setvalue(card, "value", rad)
- card.MouseButton1Click:connect(function()
- if not ui.Parent.Parent.Character:FindFirstChild("no turn") then
- if brick.value.Value == card.value.Value then
- local turnie = noturn(ui.Parent.Parent.Character)
- game.Debris:AddItem(turnie, 1)
- amount = amount - 1
- brick.value.Value = card.value.Value
- brick.Color = card.BackgroundColor3
- brick.card.Texture = card.Image
- card:remove()
- if canwin == true then
- playing = false
- end
- elseif brick.BrickColor.Name == BrickColor.new(card.BackgroundColor3).Name then
- local turnie = noturn(ui.Parent.Parent.Character)
- game.Debris:AddItem(turnie, 1)
- amount = amount - 1
- brick.value.Value = card.value.Value
- brick.Color = card.BackgroundColor3
- brick.card.Texture = card.Image
- card:remove()
- if canwin == true then
- playing = false
- end
- end
- end
- end)
- if rad == 0 then
- card.Image = "http://www.roblox.com/asset/?id=31088273"
- elseif rad == 1 then
- card.Image = "http://www.roblox.com/asset/?id=31088284"
- elseif rad == 2 then
- card.Image = "http://www.roblox.com/asset/?id=31088292"
- elseif rad == 3 then
- card.Image = "http://www.roblox.com/asset/?id=31088300"
- elseif rad == 4 then
- card.Image = "http://www.roblox.com/asset/?id=31088309"
- elseif rad == 5 then
- card.Image = "http://www.roblox.com/asset/?id=31088316"
- elseif rad == 6 then
- card.Image = "http://www.roblox.com/asset/?id=31088337"
- elseif rad == 7 then
- card.Image = "http://www.roblox.com/asset/?id=31088351"
- elseif rad == 8 then
- card.Image = "http://www.roblox.com/asset/?id=31088361"
- elseif rad == 9 then
- card.Image = "http://www.roblox.com/asset/?id=31088371"
- end
- local rad2 = math.random(1, 4)
- if rad2 == 1 then
- card.BackgroundColor3 = color("Bright red")
- end
- if rad2 == 2 then
- card.BackgroundColor3 = color("Bright blue")
- end
- if rad2 == 3 then
- card.BackgroundColor3 = color("Bright green")
- end
- if rad2 == 4 then
- card.BackgroundColor3 = color("Bright yellow")
- end
- end
- end
- end
- function playagainst(target)
- local card = Instance.new("Part", script)
- card.Name = "currentcard"
- card.Size = Vector3.new(1, 0.05, 2)
- card.Anchored = true
- card.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0, -1.99, -1)
- local decal = Instance.new("Decal", card)
- decal.Face = "Top"
- decal.Name = "card"
- local rad = math.random(0, 9)
- local val = setvalue(card, "value", rad)
- if rad == 0 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088273"
- elseif rad == 1 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088284"
- elseif rad == 2 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088292"
- elseif rad == 3 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088300"
- elseif rad == 4 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088309"
- elseif rad == 5 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088316"
- elseif rad == 6 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088337"
- elseif rad == 7 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088351"
- elseif rad == 8 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088361"
- elseif rad == 9 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088371"
- end
- local rad2 = math.random(1, 4)
- if rad2 == 1 then
- card.Color = color("Bright red")
- end
- if rad2 == 2 then
- card.Color = color("Bright blue")
- end
- if rad2 == 3 then
- card.Color = color("Bright green")
- end
- if rad2 == 4 then
- card.Color = color("Bright yellow")
- end
- local rad = math.random(0, 9)
- local gameover = false
- local theirgui = Instance.new("ScreenGui")
- local other = game:GetService("Players"):GetPlayerFromCharacter(target)
- if other then
- theirgui.Parent = other.PlayerGui
- generatecards(gui, card, target)
- generatecards(theirgui, card, plr)
- playing = true
- end
- end
- function playagainst3(target, target2)
- local card = Instance.new("Part", script)
- card.Name = "currentcard"
- card.Size = Vector3.new(1, 0.05, 2)
- card.Anchored = true
- card.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0, -1.99, -1)
- local decal = Instance.new("Decal", card)
- decal.Face = "Top"
- decal.Name = "card"
- local rad = math.random(0, 9)
- local val = setvalue(card, "value", rad)
- if rad == 0 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088273"
- elseif rad == 1 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088284"
- elseif rad == 2 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088292"
- elseif rad == 3 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088300"
- elseif rad == 4 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088309"
- elseif rad == 5 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088316"
- elseif rad == 6 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088337"
- elseif rad == 7 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088351"
- elseif rad == 8 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088361"
- elseif rad == 9 then
- decal.Texture = "http://www.roblox.com/asset/?id=31088371"
- end
- local rad2 = math.random(1, 4)
- if rad2 == 1 then
- card.Color = color("Bright red")
- end
- if rad2 == 2 then
- card.Color = color("Bright blue")
- end
- if rad2 == 3 then
- card.Color = color("Bright green")
- end
- if rad2 == 4 then
- card.Color = color("Bright yellow")
- end
- local rad = math.random(0, 9)
- local gameover = false
- local theirgui = Instance.new("ScreenGui")
- local other = game:GetService("Players"):GetPlayerFromCharacter(target)
- local other2 = game:GetService("Players"):GetPlayerFromCharacter(target2)
- if other then
- theirgui.Parent = other.PlayerGui
- generatecards(gui, card, target)
- generatecards(theirgui, card, plr)
- playing = true
- end
- if other2 then
- theirgui.Parent = other.PlayerGui
- generatecards(theirgui, card, plr)
- playing = true
- end
- end
- players = 0
- mouse = plr:GetMouse()
- mouse.Button1Down:connect(function()
- if mouse.Target and playing == false then
- if mouse.Target.Parent then
- playagainst(mouse.Target.Parent)
- end
- end
- end)
- mouse.KeyDown:connect(function(key)
- if key == "e" then
- if players < 3 then
- if plr1 == nil and plr2 == nil then
- if mouse.Target and playing == false then
- if mouse.Target.Parent then
- plr1 = mouse.Target.Parent
- end
- end
- elseif plr1 ~= nil and plr2 == nil then
- if mouse.Target and playing == false then
- if mouse.Target.Parent then
- plr2 = mouse.Target.Parent
- end
- end
- elseif plr1 == nil and plr2 ~= nil then
- if mouse.Target and playing == false then
- if mouse.Target.Parent then
- plr1 = mouse.Target.Parent
- end
- end
- elseif plr1 ~= nil and plr2 ~= nil then
- playagainst3(plr1, plr2)
- end
- end
- end
- end)
- --generatecards(gui)
- 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