|
| 12 Apr 2015 11:04 AM |
game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) local tl = Instance.new('TextLabel',game.StarterGui.ChatGui) tl.TextColor3 = Color3.new(255/255,255/255,255/255) tl.Position = UDim2.new(.2,0,.2,0) tl.BackgroundTransparency = 1 tl.Text = p.Name..' Said: '..msg wait(10) tl:remove() end) end)
Why isnt this working? |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Apr 2015 11:05 AM |
game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) local tl = Instance.new('TextLabel',p.PlayerGui.ChatGui) tl.TextColor3 = Color3.new(255/255,255/255,255/255) tl.Position = UDim2.new(.2,0,.2,0) tl.BackgroundTransparency = 1 tl.Text = p.Name..' Said: '..msg wait(10) tl:remove() end) end) |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 11:08 AM |
| Yes please crescent, so that I may learn. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 11:23 AM |
game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) local tl = Instance.new('TextLabel',p.PlayerGui.ChatGui) tl.TextColor3 = Color3.new(255/255,255/255,255/255) tl.Position = UDim2.new(.2,0,.15,0) tl.Size = UDim2.new(0,0,0,0) tl.BackgroundTransparency = 1 tl.FontSize = Enum.FontSize.Size12 tl.Text = p.Name..': '..msg wait(10) tl:remove() end) end)
Ok, so I now have this, it works. I have two questions, however. 1. How do I prevent text overlapping? 2. How do I make it visible to all players?
Thank you. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 11:27 AM |
| make an ipdate function and everytime someone talks it updates everyones gui |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 12 Apr 2015 11:36 AM |
game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) local tl = Instance.new('TextLabel',p.PlayerGui.ChatGui) local function update() if p.PlayerGui.ChatGui.BoolValue.Value == true then tl.Position = tl.Position + UDim2.new(0,0,0,26) end end Instance.new('BoolValue',p.PlayerGui.ChatGui).Value = true tl.TextColor3 = Color3.new(255/255,255/255,255/255) tl.Position = UDim2.new(.2,0,.15,0) tl.Size = UDim2.new(0,0,0,0) tl.BackgroundTransparency = 1 tl.FontSize = Enum.FontSize.Size12 tl.Text = p.Name..': '..msg wait(10) tl:remove() while wait() do update() end end) end)
Ok, so I ended up with this. Doesn't work, same thing. Not sure.. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 12 Apr 2015 02:33 PM |
function update(plr) wait() plr.PlayerGui.Leaderboard.Ok.Obj.Value = nil for i,vt in pairs(plr.PlayerGui.Leaderboard.Ok:GetChildren()) do if vt.Name ~= "Obj" then vt:Destroy() end end for i,v in pairs(game.Players:GetChildren()) do local fr =Instance.new("Frame",plr.PlayerGui.Leaderboard.Ok) fr.ZIndex = 10 local tb = Instance.new("TextButton",fr) tb.ZIndex = 10 local tb2 = Instance.new("TextButton",fr) tb2.ZIndex = 10 fr.Size = UDim2.new(1,0,0,30) fr.BackgroundColor3 = Color3.new(170/255, 170/255, 127/255) fr.BackgroundTransparency = .4 if plr.PlayerGui.Leaderboard.Ok.Obj.Value ~= nil then if not pcall(function() fr.Position = plr.PlayerGui.Leaderboard.Ok.Obj.Value.Position + UDim2.new(0,0,0,33) if #plr.PlayerGui.Leaderboard.Ok:GetChildren() >= 7 then plr.PlayerGui.Leaderboard.Ok.CanvasSize = plr.PlayerGui.Leaderboard.Ok.CanvasSize + UDim2.new(0,0,0,23) plr.PlayerGui.Leaderboard.Ok.ScrollingEnabled = true end end) then else end else fr.Position = UDim2.new(0,0,0,0) end fr.ClipsDescendants = true tb.Size = UDim2.new(.2,0,0,30) tb.Position = UDim2.new(0,0,0,0) tb.BackgroundTransparency = 1 tb.Font = "ArialBold" tb.FontSize = "Size18" tb.TextColor3 = Color3.new(0, 0, 0) tb.Text = "0" tb2.Size = UDim2.new(.7,15,0,30) tb2.Position = UDim2.new(.2,0,0,0) tb2.BackgroundTransparency = 1 tb2.Font = "ArialBold" tb2.FontSize = "Size18" tb2.TextColor3 = Color3.new(0/255, 0/255, 0/255) tb2.Text = v.Name plr.PlayerGui.Leaderboard.Ok.Obj.Value = fr end end
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function() for i,vr in pairs(game.Players:GetChildren()) do update(vr) end end) end)
last = #game.Players:GetChildren() w = coroutine.wrap(function() while wait() do if #game.Players:GetChildren() ~= last then last = #game.Players:GetChildren() for i,vr in pairs(game.Players:GetChildren()) do update(vr) end end end end)
w() |
|
|
| Report Abuse |
|
|