Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Joiner --
- --http://www49.zippyshare.com/v/38178937/file.html
- --Mouse=game.Players.LocalPlayer:GetMouse();Mouse.Button1Down:connect(function()ypcall(function()print(Mouse.Target)local a = Mouse.Target.Parent Mouse.Target:Destroy() a:Destroy() end)end)
- ScreenSize = 1000
- Players = {}
- Screens = {}
- GlobalObjects = {}
- function clerp(c1,c2,sp)
- return CFrame.new(
- c1.X+(c2.X-c1.X)*sp,
- c1.Y+(c2.Y-c1.Y)*sp,
- c1.Z+(c2.Z-c1.Z)*sp
- )
- end
- local PBT = Instance.new("Part",script)
- PBT.Transparency = 1
- PBT.Anchored = true
- local PBTG = Instance.new("SurfaceGui",PBT)
- PBTG.CanvasSize = Vector2.new(500,200)
- PBT.FormFactor = "Custom"
- PBT.Size = Vector3.new(5,2,1)
- PBTS = Vector3.new(5,2,1)
- PBTC = CFrame.new(0,3,20)
- local PBTGB = Instance.new("TextLabel",PBTG)
- PBTGB.Size = UDim2.new(1,0,1,0)
- PBTGB.BackgroundColor3 = Color3.new(0,1,0)
- PBTGB.Text = "Play"
- PBTGB.TextScaled = true
- PBT.CFrame = CFrame.new(0,2,0)
- local Play = Instance.new("ClickDetector",PBT)
- Play.MouseClick:connect(function(player)
- ypcall(function()
- if not player:findFirstChild("IsPlaying") then
- NLS(game:GetService("HttpService"):GetAsync("http://pastebin.com/raw.php?i=m8JPNBBn"),player.Backpack)
- end
- end)
- end)
- function NewScreen(World)
- local PlayerGui = Instance.new("Part",script)
- PlayerGui.Anchored = true
- PlayerGui.FormFactor = "Custom"
- --PlayerGui.Size = Vector3.new(ScreenSize/100,ScreenSize/100,0)
- PlayerGui.CFrame = CFrame.new(0,(ScreenSize/100)/2,0)
- PlayerGui.Transparency = 1
- local Play = Instance.new("ClickDetector",PlayerGui)
- local A = #Screens+1
- Play.MouseClick:connect(function(player)
- ypcall(function()
- --[[if not player:findFirstChild("IsPlaying") then
- NLS(game:GetService("HttpService"):GetAsync("http://pastebin.com/raw.php?i=m8JPNBBn"),player.Backpack)
- end]]
- CurrentWorld = A
- end)
- end)
- local Screen = Instance.new("SurfaceGui",PlayerGui)
- Screen.Name = "2DGame"
- Screen.CanvasSize = Vector2.new(ScreenSize,ScreenSize)
- local Background = Instance.new("ImageLabel",Screen)
- BackgroundID = World.ID
- Background.Image = "http://www.roblox.com/asset/?id="..BackgroundID-1
- Background.Size = UDim2.new(0,1000,0,600)
- Background.Position = UDim2.new(0.5,-500,0.5,-300)
- local Title = Instance.new("TextLabel",Background)
- Title.Size = UDim2.new(0,200,0,50)
- Title.Text = "World"
- Title.TextColor3 = Color3.new(0.5,0.5,0.5)
- Title.TextWrapped = false
- Title.BackgroundTransparency = 1
- Title.FontSize = "Size14"
- Title.Position = UDim2.new(0.5,-100,0,0)
- local A = {}
- A.PG = PlayerGui
- A.SC = Screen
- A.BK = Background
- A.World = World
- A.Title = Title
- A.PlayButton = Play
- table.insert(Screens,A)
- return A
- end
- Worlds = {
- --{Height = 400,ID = 161283188,Size = Vector2.new(1000,600),Objects={}},
- --{Height = 400,ID = 161397987,Size = Vector2.new(1000,600),Objects={}},
- --{Height = 400,ID = 161402869,Size = Vector2.new(1000,600),Objects={}},
- --{Height = 400,ID = 161413779,Size = Vector2.new(1000,600),Objects={}}
- }
- function NewWorld(Name,Height,ID,TSize)
- local A = {}
- A.Height = Height
- A.ID = ID
- A.Size = TSize
- A.Objects = {}
- A.Name = Name
- function A:NewObject(LSize,LPosition)
- local B = Instance.new("Frame",Background)
- B.Size = UDim2.new(0,LSize.X,0,LSize.Y)
- B.Position = UDim2.new(0,LPosition.X,0,LPosition.Y)
- local C = {}
- C.B = B
- C.World = A
- function C:IsAbove(V)
- local X = V.X
- local Y = V.Y
- if Y < B.Position.Y.Offset+LSize.Y/2 and X > B.Position.X.Offset and X < B.Position.X.Offset+LSize.X then
- return true
- else
- return nil
- end
- end
- function C:IsBelow(V)
- local X = V.X
- local Y = V.Y
- if Y > B.Position.Y.Offset+LSize.Y/2 and X > B.Position.X.Offset and X < B.Position.X.Offset+LSize.X then
- return true
- else
- return nil
- end
- end
- table.insert(A.Objects,C)
- table.insert(GlobalObjects,Y)
- end
- table.insert(Worlds,A)
- return A
- end
- First = NewWorld("Grasslands(Earth)",500,161283188,Vector2.new(1000,600))
- First:NewObject(Vector2.new(100,50),Vector2.new(0,400))
- First:NewObject(Vector2.new(100,50),Vector2.new(150,350))
- NewWorld("Terrain(Earth)",500,161397987,Vector2.new(1000,600))
- NewWorld("Cloudy(Earth)",500,161402869,Vector2.new(1000,600))
- NewWorld("Maket(Planet)",500,161413779,Vector2.new(1000,600))
- for i,v in pairs(Worlds) do
- NewScreen(v)
- end
- function ChangeToWorld(Num)
- if Worlds[Num] then
- for i,v in pairs(RealWorld.Objects) do
- v.B.Visible = false
- end
- CurrentWorld = Num
- end
- local Length
- if tonumber(Num) then
- Length = 1
- else
- Length = #Num
- end
- for i,v in pairs(Worlds) do
- if string.sub(v.Name,1,Length) == Num then
- for i,v in pairs(RealWorld.Objects) do
- v.B.Visible = false
- end
- CurrentWorld = i
- end
- end
- end
- function ChangeWorld(up)
- if up then
- ChangeToWorld(CurrentWorld+1)
- else
- ChangeToWorld(CurrentWorld-1)
- end
- end
- function GetOffsetByRotation(Rotation,Position,Offset)
- end
- CurrentWorld = 1
- RealWorld = Worlds[CurrentWorld]
- --[[GoForward = Instance.new("TextButton",Background)
- GoForward.Size = UDim2.new(0,40,0,40)
- GoForward.Text = ">"
- GoForward.TextScaled = true
- GoForward.BackgroundColor3 = Color3.new(255,255,0)
- GoForward.Position = UDim2.new(1,-50,0.5,-20)
- GoForward.ZIndex = 10
- GoBackward = Instance.new("TextButton",Background)
- GoBackward.Size = UDim2.new(0,40,0,40)
- GoBackward.Text = "<"
- GoBackward.TextScaled = true
- GoBackward.BackgroundColor3 = Color3.new(255,255,0)
- GoBackward.Position = UDim2.new(0,10,0.5,-20)
- GoBackward.ZIndex = 10
- GoForward.MouseButton1Click:connect(function()
- ChangeWorld(true)
- end)
- GoBackward.MouseButton1Click:connect(function()
- ChangeWorld(false)
- end)
- HD = false
- FD = false
- Jump = false]]
- mc = math.ceil
- Commands = {}
- --0.5,0.5,0.5
- function NewPlayer(Pos)
- local NHealth = Pos:findFirstChild("Health")
- local NRemote = Pos:findFirstChild("Remote")
- local NChatted = Pos:findFirstChild("Chatted")
- if NHealth and NRemote and NChatted and Pos.Parent and Pos.Parent:IsA("Player") then
- local NPlayerInstance = Pos.Parent
- local NPlayer = Instance.new("Frame",Background)
- NPlayer.Size = UDim2.new(0,40,0,100)
- NPlayer.Position = UDim2.new(0,Pos.Value.X,0,Pos.Value.Y-100)
- local NHead = Instance.new("Frame",Background)
- NHead.Size = UDim2.new(0,40,0,30)
- local NEye = Instance.new("Frame",NHead)
- NEye.BackgroundColor3 = Color3.new(0,0,0)
- NEye.Position = UDim2.new(0,5,0,10)
- NEye.Size = UDim2.new(0,10,0,10)
- local C = Instance.new("TextLabel",Background)
- C.TextColor3 = Color3.new(1,1,1)
- C.TextStrokeColor3 = Color3.new(0,0,0)
- C.TextStrokeTransparency = 0.5
- C.Text = tostring(Pos.Parent)
- C.ZIndex = 6
- C.Size = UDim2.new(0,C.TextBounds.X,0,C.TextBounds.Y)
- C.BackgroundTransparency = 1
- local D = {}
- D.F = NPlayer
- D.Pos = Pos
- D.H = NHead
- D.C = C
- D.World = NHealth.Value.Z
- D.Chats = {}
- for i,v in pairs(Pos:GetChildren()) do
- D[v.Name]=v
- end
- D.ChatTxt = function(chat)
- if not D.Deleted then
- local Chat = {}
- Chat.Pos = 0
- Chat.Gui = Instance.new("TextLabel",Background)
- Chat.Gui.Text = chat
- Chat.Age = 0
- Chat.Gui.Size = UDim2.new(0,Chat.Gui.TextBounds.X+30,0,Chat.Gui.TextBounds.Y+10)
- Chat.Gui.BackgroundColor3 = Color3.new(1,1,1)
- Chat.Gui.BackgroundTransparency = 0.5
- Chat.Gui.BorderSizePixel = 0
- for i,v in pairs(D.Chats) do
- v.Pos = v.Pos +30
- end
- table.insert(D.Chats,Chat)
- if #D.Chats > 3 then
- D.Chats[1].Gui:Destroy()
- table.remove(D.Chats,1)
- end
- end
- end
- D.Player = NPlayerInstance
- D.Deleted = false
- function D:Destroy()
- if not D.Deleted then
- for i,v in pairs(Players) do
- if v == D then
- table.remove(Players,i)
- v.F:Destroy()
- v.C:Destroy()
- v.H:Destroy()
- v.Deleted = true
- for i,v in pairs(v.Chats) do
- v.Gui:Destroy()
- end
- end
- end
- end
- end
- NPlayerInstance.CharacterAdded:connect(function()
- D:Destroy()
- for i,v in pairs(NPlayerInstance:GetChildren()) do
- if v.Name == "IsPlaying" then
- v:Destroy()
- end
- end
- end)
- D.Player.Chatted:connect(function(chat)
- D.ChatTxt(chat)
- end)
- table.insert(Players,D)
- --print("New Player: " ..tostring(Pos.Parent),Pos.Value)
- end
- end
- function FindPlayer(Name)
- local FoundName = nil
- for i,v in pairs(Players) do
- if v.Pos.Parent then
- if v.Pos.Parent.Name == Name then
- FoundName = true
- end
- end
- end
- return FoundName
- end
- coroutine.resume(coroutine.create(function()
- while wait(1) do
- for i,d in pairs(Players) do
- for i,v in pairs(d.Chats) do
- v.Age = v.Age +1
- if v.Age > 5 then
- v.Gui:Destroy()
- table.remove(d.Chats,i)
- end
- end
- end
- end
- end))
- while wait() do
- --[[if Worlds[CurrentWorld+1] then
- GoForward.Visible = true
- else
- GoForward.Visible = false
- end
- if Worlds[CurrentWorld-1] then
- GoBackward.Visible = true
- else
- GoBackward.Visible = false
- end]]
- --print(Worlds)
- --print(RealWorld)
- for i,v in pairs(game.Players:GetPlayers()) do
- if v ~= Player then
- if v:findFirstChild("IsPlaying") then
- if not FindPlayer(v.Name) then
- NewPlayer(v:findFirstChild("IsPlaying"))
- end
- end
- end
- end
- PBT.Size = clerp(PBT.Size,PBTS,0.1).p
- PBT.CFrame = clerp(PBT.CFrame,PBTC,0.1)
- if PBT.CFrame.Y > PBTC.Y+5 then
- PBT.CFrame = PBTC
- end
- for _,World in pairs(Screens) do
- local SZR = 100
- if _ ~= CurrentWorld then
- SZR = 250
- end
- RealWorld = World.World
- World.BK.Size = UDim2.new(0,RealWorld.Size.X,0,RealWorld.Size.Y)
- World.PG.Size = clerp(World.PG.Size,Vector3.new(1500/SZR,1500/SZR,1),0.1).p
- World.PG.CFrame = clerp(World.PG.CFrame,CFrame.new(((1500/100)*-((_-CurrentWorld))),((1500/100)/2)+5,20),0.1)
- --[[World.PG.CFrame = clerp(World.PG.CFrame,
- CFrame.new(0,25,20)
- *CFrame.Angles(0,0,math.rad(360*(_/#Screens))-math.rad(360*(CurrentWorld/#Worlds))+math.rad(180))
- *CFrame.new(0,15,0)
- ,0.1)]]
- World.Title.Text = RealWorld.Name
- if World.BK.Image ~= "http://www.roblox.com/asset/?id="..RealWorld.ID-1 then
- World.BK.Image = "http://www.roblox.com/asset/?id="..RealWorld.ID-1
- end
- for i,v in pairs(RealWorld.Objects) do
- v.B.Visible = true
- v.B.Parent = v.SC
- end
- for i,v in pairs(Players) do
- v.World = v.Health.Value.Z
- if Worlds[v.World] == RealWorld then
- --[[if v.World ~= CurrentWorld then
- v.F.Visible = false
- v.H.Visible = false
- v.C.Visible = false
- for i,d in pairs(v.Chats) do
- d.Gui.Visible = false
- end
- else
- v.F.Visible = true
- v.H.Visible = true
- v.C.Visible = true
- for i,d in pairs(v.Chats) do
- d.Gui.Visible = true
- end
- end]]
- v.F.Position = UDim2.new(0,v.Pos.Value.X,0.5,v.Pos.Value.Y-400)
- v.F.Parent = World.SC
- v.H.Position = v.F.Position -UDim2.new(0,0,0,30)
- v.H.Rotation = v.Pos.Value.Z
- v.H.Parent = World.SC
- v.C.Position = v.F.Position -UDim2.new(0,0,0,90)
- v.C.Text = tostring(v.Pos.Parent)
- v.C.Parent = World.SC
- --print(v.Chatted)
- for _,d in pairs(v.Chats) do
- d.Gui.Position = v.F.Position-UDim2.new(0,(-5)+((#d.Gui.Text*5)/2+5),0,120+(d.Pos))
- d.Gui.Size = UDim2.new(0,(#d.Gui.Text*5)+10,0,20)
- d.Gui.Parent = World.SC
- end
- v.C.Size = UDim2.new(0,v.C.TextBounds.X,0,v.C.TextBounds.Y)
- --print(v.Count)
- --print(v.Health.Value.Z)
- if not v.Pos.Parent or not v.Pos.Parent:IsA("Player") or not v.Pos.Parent:IsDescendantOf(game.Players) then
- v:Destroy()
- end
- v.Count = v.Health.Value.Z
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement