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
 

Re: Chat GUI Problems

Previous Thread :: Next Thread 
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
23 Apr 2014 04:44 PM
Okay, so I've only just developed this chat gui, but it works fine (I made it specifically for me for testing), but there is one problem. When I talk, no errors appear but instead of bringing up my text it just says 'Label'.

--Get Rank function:

function getRank(plr)
if ranked[plr.Name] then
return ranked[plr.Name][1]
else
return 'Guest'
end
end

-- The create chat function:

function createChatGui(player)
if game.Players:findFirstChild(player.Name) then
coroutine.resume(coroutine.create(function()
if player.PlayerGui:findFirstChild('chatg') then
player.PlayerGui.chatg:Destroy()
end
end))
scr=Instance.new('ScreenGui',player.PlayerGui)
scr.Name='chatg'
fr=Instance.new('Frame',scr)
fr.Size=UDim2.new(0,200,0,300)
fr.Position=UDim2.new(0,0,0,200)
fr.BackgroundTransparency=1
player.Chatted:connect(function(ms)
msg=msg+1
coroutine.resume(coroutine.create(function()
if msg==1 then
l=getRank(player)
tr=Instance.new('TextLabel',fr)
tr.BackgroundTransparency=1
tr.Size=UDim2.new(0,600,0,50)
tr.Position=UDim2.new(0,50,0,20)
tr.Font="ArialBold"
tr.FontSize="Size18"
tl.Text=l..': '..ms
coroutine.resume(coroutine.create(function()
if string.len(tl.Text)>250 then
tl.Text=l..': '..ms:sub(1,250)..'...'
end
if l=="Owner" then
tr.TextColor3=Color3.new(1,0,0)
tr.TextStrokeColor3=Color3.new(1,1,0)
end
if l=="Nob" then
tr.TextColor3=Color3.new(0,0,0)
tr.TextStrokeColor3=Color3.new(1,1,1)
end
if l=="Noob" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
if l=="Guest" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
end))
end
if msg==2 then
l=getRank(player)
tr=Instance.new('TextLabel',fr)
tr.BackgroundTransparency=1
tr.Size=UDim2.new(0,600,0,50)
tr.Position=UDim2.new(0,50,0,90)
tr.Font="ArialBold"
tr.FontSize="Size18"
tl.Text=l..': '..ms
coroutine.resume(coroutine.create(function()
if string.len(tl.Text)>250 then
tl.Text=l..': '..ms:sub(1,250)..'...'
end
if l=="Owner" then
tr.TextColor3=Color3.new(1,0,0)
tr.TextStrokeColor3=Color3.new(1,1,0)
end
if l=="Nob" then
tr.TextColor3=Color3.new(0,0,0)
tr.TextStrokeColor3=Color3.new(1,1,1)
end
if l=="Noob" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
if l=="Guest" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
end))
end
if msg==3 then
l=getRank(player)
tr=Instance.new('TextLabel',fr)
tr.BackgroundTransparency=1
tr.Size=UDim2.new(0,600,0,50)
tr.Position=UDim2.new(0,50,0,160)
tr.Font="ArialBold"
tr.FontSize="Size18"
tl.Text=l..': '..ms
coroutine.resume(coroutine.create(function()
if string.len(tl.Text)>250 then
tl.Text=l..': '..ms:sub(1,250)..'...'
end
if l=="Owner" then
tr.TextColor3=Color3.new(1,0,0)
tr.TextStrokeColor3=Color3.new(1,1,0)
end
if l=="Nob" then
tr.TextColor3=Color3.new(0,0,0)
tr.TextStrokeColor3=Color3.new(1,1,1)
end
if l=="Noob" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
if l=="Guest" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
end))
end
if msg==4 then
l=getRank(player)
tr=Instance.new('TextLabel',fr)
tr.BackgroundTransparency=1
tr.Size=UDim2.new(0,600,0,50)
tr.Position=UDim2.new(0,50,0,230)
tr.Font="ArialBold"
tr.FontSize="Size18"
tl.Text=l..': '..ms
coroutine.resume(coroutine.create(function()
if string.len(tl.Text)>250 then
tl.Text=l..': '..ms:sub(1,250)..'...'
end
if l=="Owner" then
tr.TextColor3=Color3.new(1,0,0)
tr.TextStrokeColor3=Color3.new(1,1,0)
end
if l=="Nob" then
tr.TextColor3=Color3.new(0,0,0)
tr.TextStrokeColor3=Color3.new(1,1,1)
end
if l=="Noob" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
if l=="Guest" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
end))
end
if msg==5 then
l=getRank(player)
tr=Instance.new('TextLabel',fr)
tr.BackgroundTransparency=1
tr.Size=UDim2.new(0,600,0,50)
tr.Position=UDim2.new(0,50,0,290)
tr.Font="ArialBold"
tr.FontSize="Size18"
tl.Text=l..': '..ms
coroutine.resume(coroutine.create(function()
if string.len(tl.Text)>250 then
tl.Text=l..': '..ms:sub(1,250)..'...'
end
if l=="Owner" then
tr.TextColor3=Color3.new(1,0,0)
tr.TextStrokeColor3=Color3.new(1,1,0)
end
if l=="Nob" then
tr.TextColor3=Color3.new(0,0,0)
tr.TextStrokeColor3=Color3.new(1,1,1)
end
if l=="Noob" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
if l=="Guest" then
tr.TextColor3=Color3.new(1,1,1)
tr.TextStrokeColor3=Color3.new(0,0,0)
end
end))
end
if msg>5 then
msg=0
scr:Destroy()
createChatGui(player)
end
end))
end)
end
end
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
23 Apr 2014 04:48 PM
Please reply to this.
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
23 Apr 2014 04:51 PM
Ok.
Report Abuse
masterCameron101 is not online. masterCameron101
Joined: 28 Mar 2010
Total Posts: 1377
23 Apr 2014 05:04 PM
TextObject.Text=msg

~masterCameron101, advanced Lua programmer, certified graphics designer and geek~
Report Abuse
12packkid is not online. 12packkid
Joined: 24 Jun 2011
Total Posts: 1418
23 Apr 2014 09:24 PM
@master, here's a list of the objects:

msg > Msg is a variable that only goes up to five. Once it goes over 5, it resets back to 1.

tr > TextLabel (BTW, I already added the text in)
scr > ScreenGui
fr > Frame
player > argument in the createChatGui function

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