Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- launchers = {
- {["Name"] = "Mobile Mode",["Exec"]=function(player) Update_Interface_Type(player,"Phone") end},
- {["Name"] = "Computer Mode",["Exec"]=function(player) Update_Interface_Type(player,"Computer") end},
- {["Name"] = "Chat",["Exec"]=function(player) ChatWindow(player) end},
- {["Name"] = "Status",["Exec"]=function(player) StatusWindow(player) end},
- }
- message_history = {}
- player_index = {}
- Get_Player_Index = function(playe)
- local tbl = {}
- local num = 0
- for i,v in pairs(player_index) do
- if v["Player"]==playe.Name then
- tbl = v["Chat_Index"]
- end
- end
- return tbl
- end
- Update_Interface_Type = function(playe,type)
- for i,v in pairs(player_index) do
- if v["Player"]==playe.Name then
- v["DeviceType"] = type
- end
- end
- end
- Get_Interface_Type = function(playe)
- local type = ""
- for i,v in pairs(player_index) do
- if v["Player"]==playe.Name then
- type = v["DeviceType"]
- end
- end
- return type
- end
- Update_Player_Index = function(playe,tbl)
- for i,v in pairs(player_index) do
- if v["Player"]==playe.Name then
- v["Chat_Index"]={}
- for i=1,#tbl do
- table.insert(v["Chat_Index"],tbl[i])
- end
- end
- end
- end
- CreateWindow = function(player,size,pos,title,par)
- local root = nil
- local gui=Instance.new("ScreenGui",player.PlayerGui)
- gui.Name = "EWindowGui"
- local frame=Instance.new("Frame")
- if par==nil then
- frame.Parent = gui
- root = gui
- else
- frame.Parent = par
- root = frame
- gui:Remove()
- end
- frame.BackgroundColor3 = Color3.new ( 141/255, 200/255, 251/255)
- frame.Position = pos
- frame.Size = size
- frame.Active = true
- frame.Draggable = true
- if Get_Interface_Type(player)=="Phone" then
- frame.Size = UDim2.new( 1, 0, 1, 0)
- frame.Position = UDim2.new( 0, 0, 0, 0)
- frame.Active = false
- frame.Draggable = false
- end
- frame.BackgroundTransparency = 0.4
- local tl=Instance.new("TextLabel",frame)
- tl.BackgroundTransparency = 1
- tl.Position = UDim2.new ( 0, 0, 0, 0)
- tl.Size = UDim2.new ( 1, 0, 0, 22)
- tl.FontSize = "Size14"
- tl.Text = title
- tl.TextColor3 = Color3.new ( 0, 0, 0)
- tl.TextXAlignment = "Left"
- local exit = Instance.new("TextButton",frame)
- exit.AutoButtonColor = false
- exit.BorderSizePixel = 0
- exit.BackgroundColor3 = Color3.new ( 199/255, 80/255, 80/255)
- exit.Size = UDim2.new ( 0, 56, 0, 22)
- exit.Position = UDim2.new ( 1, -64, 0, 0)
- exit.Text = "X"
- exit.FontSize = Enum.FontSize.Size18
- exit.TextColor3 = Color3.new ( 1, 1, 1)
- exit.MouseButton1Click:connect(function()
- root:Remove()
- end)
- local Window_Elements = Instance.new("Frame",frame)
- Window_Elements.Size = UDim2.new( 1, -8, 1, -30)
- Window_Elements.Position = UDim2.new ( 0, 4, 0, 26)
- Window_Elements.BackgroundColor3 = Color3.new(1, 1, 1)
- return Window_Elements, root
- end
- CMessage = function(player,title,text,par)
- local frame,sgui = CreateWindow(player,UDim2.new(0,400,0,150),UDim2.new (0.5,-200,0.5,-75),title,par)
- local text1 = Instance.new("TextLabel",frame)
- text1.BackgroundTransparency = 1
- text1.Size = UDim2.new ( 0.9, 0, 0.65, 0)
- text1.TextWrapped = true
- text1.Position = UDim2.new ( 0, 0, 0, 0)
- text1.Text = text
- text1.TextColor3 = Color3.new ( 0, 0, 0)
- text1.TextXAlignment = Enum.TextXAlignment.Left
- text1.TextYAlignment = Enum.TextYAlignment.Top
- text1.FontSize = "Size14"
- local ok = Instance.new("TextButton",frame)
- ok.AutoButtonColor = false
- ok.BorderColor3 = Color3.new(41/255, 200/255, 251/255)
- ok.BackgroundColor3 = Color3.new ( 1, 1, 1)
- ok.Size = UDim2.new ( 0.5, 0, 0.3, 0)
- ok.Position = UDim2.new ( 0.25, 0, 0.65, 0)
- ok.Text = "OK"
- ok.FontSize = Enum.FontSize.Size18
- ok.TextColor3 = Color3.new ( 0, 0, 0)
- ok.MouseButton1Click:connect(function()
- sgui:Remove()
- end)
- end
- ChatWindow = function(player)
- local chatele,fullgui=CreateWindow(player,UDim2.new( 0, 400, 0, 250),UDim2.new( 1, -450, 1, -300),"Roblox.Chat")
- local update=function()
- chatele:ClearAllChildren()
- for i,v in pairs(message_history) do
- local tl=Instance.new("TextLabel",chatele)
- tl.Position = UDim2.new( 0, 0, (#chatele:GetChildren()-1)*.05, 0)
- tl.Size = UDim2.new ( 1, 0, 0.05, 0)
- tl.BackgroundTransparency = 1
- tl.TextXAlignment = "Left"
- tl.Text = v["Player"] .. " : " .. v["Message"]
- end
- end
- coroutine.resume(coroutine.create(function()
- while wait() do
- if Get_Player_Index(player)~=message_history then
- update()
- Update_Player_Index(player,message_history)
- end
- end
- end))
- end
- Get_Status = function(player)
- local tabl = {}
- local hum = player.Character:FindFirstChild("Humanoid")
- if hum~=nil then
- table.insert(tabl,"Health: " .. hum.Health)
- table.insert(tabl,"MaxHealth: " .. hum.MaxHealth)
- table.insert(tabl,"WalkSpeed: " .. hum.WalkSpeed)
- end
- table.insert(tabl,"AccountAge: " .. player.AccountAge)
- return tabl
- end
- StatusWindow = function(player)
- local statusele,statuswin = CreateWindow(player,UDim2.new( 0, 150, 0, 200),UDim2.new( 0, 20, 1, -300),"State")
- local create = function()
- statusele:ClearAllChildren()
- for i=1,10 do
- local tl = Instance.new("TextLabel",statusele)
- tl.Size = UDim2.new( 1, 0, 0.1, 0)
- tl.Position = UDim2.new( 0, 0, (i-1)*.1, 0)
- tl.BackgroundTransparency = 1
- tl.Text = ""
- tl.TextXAlignment = "Left"
- end
- end
- local update = function()
- local tbl = Get_Status(player)
- local chil = statusele:GetChildren()
- for i=1,#tbl do
- chil[i].Text = tbl[i]
- end
- if #chil>=#tbl+1 then
- for i=#tbl+1,#chil do
- chil[i].Text = ""
- end
- end
- end
- create()
- coroutine.resume(coroutine.create(function()
- while wait() do
- update()
- end
- end))
- end
- function Update_History(playername, message)
- if #message_history>=20 then
- table.remove(message_history,1)
- end
- table.insert(message_history,{["Player"]=playername,["Message"] = message})
- end
- function Chat(speaker, message)
- message = message
- if string.sub((message),1,3)=="/e " then
- message = "[Roblox Emotion]"
- end
- Update_History(speaker.Name, message)
- end
- function Launcher(player)
- local gui = Instance.new("ScreenGui",player.PlayerGui)
- local ib = Instance.new("ImageButton",gui)
- ib.Size = UDim2.new( 0, 50, 0, 50)
- ib.Position = UDim2.new ( 1, -50, 1, -50)
- ib.Image = "http://www.roblox.com/asset/?id=108116980"
- ib.MouseButton1Click:connect(function()
- local buttonhold,corelaunch = CreateWindow(player,UDim2.new( 0, 400, 0, 300),UDim2.new(0,100,0,100),"Select action",gui)
- local itemnum = #launchers
- for i,v in pairs(launchers) do
- local tb = Instance.new("TextButton",buttonhold)
- tb.Size = UDim2.new(1, 0, 1/itemnum, 0)
- tb.BorderSizePixel = 0
- tb.Position = UDim2.new(0, 0,(i-1)*(1/itemnum), 0)
- tb.Text = v["Name"]
- tb.BackgroundColor3 = Color3.new ( 1, 1, 1)
- tb.TextScaled = true
- tb.MouseButton1Click:connect(function()
- v["Exec"](player)
- corelaunch:Remove()
- end)
- end
- end)
- end
- function OnEnter(player,need)
- player.Chatted:connect(function(msg) Chat(player, msg) end)
- if need==true then
- Launcher(player)
- end
- table.insert(player_index,{["Player"]=player.Name,["DeviceType"]="Computer",["Chat_Index"]={}})
- player.CharacterAdded:connect(function(ch) Launcher(player) end)
- end
- game.Players.PlayerAdded:connect(function(pl) OnEnter(pl,false) Update_History("[System]",pl.Name .. " has entered the game") end)
- plsr = game.Players:GetChildren()
- for i=1,#plsr do
- OnEnter(plsr[i],true)
- end
- game.Players.PlayerRemoving:connect(function(player)
- for i,v in pairs(player_index) do
- if v["Player"]==player.Name then
- table.remove(player_index,i)
- end
- end
- Update_History("[System]",player.Name .. " has left the game")
- end)
- _G.Fetch = function(player)
- for i,v in pairs(message_history) do
- print(v["Player"] .. " : " .. v["Message"])
- end
- for i,v in pairs(Get_Player_Index(player)) do
- print(v["Player"] .. " : " .. v["Message"])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement