generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Pseudo Chat Gui

Previous Thread :: Next Thread 
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 01:29 PM
game:service'Players'.PlayerAdded:connect(function(p)
if not p:WaitForChild'PlayerGui':FindFirstChild('CHAT') then
local gui=Instance.new('ScreenGui',p:WaitForChild'PlayerGui').Name='CHAT'
local frame=Instance.new('Frame',gui)
frame.Size=UDim2.new(0,200,0,250)
frame.BackgroundTransparency=1
end
if not game:service'StarterGui':FindFirstChild('CHAT') then
gui:Clone().Parent=game:service'StarterGui'
end
p.Chatted:connect(function(msg)
makeMsg(p.Name': '..msg)
end)
end)

local makeMsg=function(m)
for _,p in pairs(game:service'Players':GetPlayers()) do
for _,t in pairs(p:WaitForChild'PlayerGui'.CHAT.Frame:GetChildren()) do
if t:IsA'TextLabel' then
t.Position=t.Position-UDim2.new(0,0,0,25)
if t and t.Position.Y.Offset<0 then
t:Destroy()
end
end
local msg=Instance.new('TextLabel',p:WaitForChild'PlayerGui'.CHAT.Frame)
msg.BackgroundTransparency=1
msg.FontSize='Size24'
msg.Text=m
msg.Position=UDim2.new(0,0,0,225)
msg:Clone().Parent=game:service'StarterGui'.CHAT.Frame
end
for _,b in ipairs(game:service'StarterGui'.CHAT.Frame:GetChildren()) do
if b:IsA'TextLabel' then
b.Position=b.Position-UDim2.new(0,0,0,25)
if b.Position.Y.Offset<0 then
b:Destroy()
end
end
end
end

Does this work? Sorry for typos. I literally just typed all of that on this post without testing or using studio. I can't test it now because I'm on an iPod. So can someone tell me if this works? This is a serverscript inside ServerScriptService.
Thanks! This doesn't require any setting up.
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 01:39 PM
I just need someone to test this.
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 02:49 PM
D:
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
28 Jun 2014 02:53 PM
One line already has an error.

local gui = Instance.new('ScreenGui',p:WaitForChild'PlayerGui').Name='CHAT'

unexpected symbol near '='
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 03:18 PM
game:service'Players'.PlayerAdded:connect(function(p)
if not p:WaitForChild'PlayerGui':FindFirstChild('CHAT') then
local gui=Instance.new('ScreenGui',p:WaitForChild'PlayerGui')
gui.Name='CHAT'
local frame=Instance.new('Frame',gui)
frame.Size=UDim2.new(0,200,0,250)
frame.BackgroundTransparency=1
end
if not game:service'StarterGui':FindFirstChild('CHAT') then
gui:Clone().Parent=game:service'StarterGui'
end
p.Chatted:connect(function(msg)
makeMsg(p.Name': '..msg)
end)
end)

local makeMsg=function(m)
for _,p in ipairs(game:service'Players':GetPlayers()) do
for _,t in ipairs(p:WaitForChild'PlayerGui'.CHAT.Frame:GetChildren()) do
if t:IsA'TextLabel' then
t.Position=t.Position-UDim2.new(0,0,0,25)
if t and t.Position.Y.Offset<0 then
t:Destroy()
end
end
local msg=Instance.new('TextLabel',p:WaitForChild'PlayerGui'.CHAT.Frame)
msg.BackgroundTransparency=1
msg.FontSize='Size24'
msg.Text=m
msg.Position=UDim2.new(0,0,0,225)
msg:Clone().Parent=game:service'StarterGui'.CHAT.Frame
end
for _,b in ipairs(game:service'StarterGui'.CHAT.Frame:GetChildren()) do
if b:IsA'TextLabel' then
b.Position=b.Position-UDim2.new(0,0,0,25)
if b.Position.Y.Offset<0 then
b:Destroy()
end
end
end
end

Try this.
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
28 Jun 2014 03:50 PM
It really doesn't look different.
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 04:03 PM
Try it. I changed a few things.
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
28 Jun 2014 04:12 PM
I tried the new one.

I don't see a real difference.
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 04:42 PM
No output?
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
28 Jun 2014 04:45 PM
17:44:56.584 - Players.Player1.PlayerGui.ScreenGui.Script:10: attempt to index global 'gui' (a nil value)
17:44:56.589 - Stack Begin
17:44:56.592 - Script 'Players.Player1.PlayerGui.ScreenGui.Script', Line 10
17:44:56.595 - Stack End
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
28 Jun 2014 04:48 PM
game:service'Players'.PlayerAdded:connect(function(p)
if not p:WaitForChild'PlayerGui':FindFirstChild('CHAT') then
gui=Instance.new('ScreenGui',p:WaitForChild'PlayerGui')
gui.Name='CHAT'
local frame=Instance.new('Frame',gui)
frame.Size=UDim2.new(0,200,0,250)
frame.BackgroundTransparency=1
end
if not game:service'StarterGui':FindFirstChild('CHAT') then
gui:Clone().Parent=game:service'StarterGui'
end
p.Chatted:connect(function(msg)
makeMsg(p.Name': '..msg)
end)
end)

local makeMsg=function(m)
for _,p in ipairs(game:service'Players':GetPlayers()) do
for _,t in ipairs(p:WaitForChild'PlayerGui'.CHAT.Frame:GetChildren()) do
if t:IsA'TextLabel' then
t.Position=t.Position-UDim2.new(0,0,0,25)
if t and t.Position.Y.Offset<0 then
t:Destroy()
end
end
local msg=Instance.new('TextLabel',p:WaitForChild'PlayerGui'.CHAT.Frame)
msg.BackgroundTransparency=1
msg.FontSize='Size24'
msg.Text=m
msg.Position=UDim2.new(0,0,0,225)
msg:Clone().Parent=game:service'StarterGui'.CHAT.Frame
end
for _,b in ipairs(game:service'StarterGui'.CHAT.Frame:GetChildren()) do
if b:IsA'TextLabel' then
b.Position=b.Position-UDim2.new(0,0,0,25)
if b.Position.Y.Offset<0 then
b:Destroy()
end
end
end
end
Report Abuse
Krosskode is not online. Krosskode
Joined: 26 Aug 2010
Total Posts: 11001
28 Jun 2014 05:06 PM
18:04:53.818 - Started network server 127.0.0.1|53640
Hello world!
Hello world!
Hello world!
18:04:53.859 - No assetUrl set
18:04:53.859 - Script 'ServerScriptService.Kohl's Admin Commands V2', Line 2436
18:04:53.860 - Stack End
18:04:54.067 - Successfully opened file - C:/Users/trevo_000/AppData/Local/Roblox/server.rbxl
18:04:54.646 - MarketplaceService:GetProductInfo() productInfoUrl is empty
18:04:54.647 - Script 'ServerScriptService.LuaModelMaker's Admin', Line 546
18:04:54.647 - Stack End
18:05:02.325 - New connection from 127.0.0.1|64446

Player -1 added
18:05:04.977 - Players.Player1.PlayerGui.Script:42: '=' expected near 'Abuse'
18:05:05.888 - New connection from 127.0.0.1|49869

Player -2 added
18:05:07.682 - Players.Player2.PlayerGui.Script:42: '=' expected near 'Abuse'
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image