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
|
  |
| 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 |
|