Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Player chatted function not working??

Asked by 8 years ago
1player.Chatted:connect(function(msg)
2UpdateChat()
3NewChat(player, msg)
4end)

for some reason, this isn't working but i'm sure there's nothing wrong there so i suspect its in the NewChat function.

01function NewChat(player, msg)
02local ChatFrame = Instance.new("TextLabel", script.CHATGUI.ChatGUI)
03ChatFrame.Size = UDim2.new(0.8, 0, 0.1, 0)
04ChatFrame.Position = UDim2.new(-1, 0, 0.8, 0)
05ChatFrame.TextXAlignment = "Left"
06ChatFrame.TextColor3 = Color3.new(1, 1, 1)
07ChatFrame.TextStrokeColor3 = Color3.new(0, 0, 0)
08ChatFrame.TextStrokeTransparency = 0
09ChatFrame.BackgroundTransparency = 1
10ChatFrame.FontSize = "Size18"
11ChatFrame.TextColor3 = Color3.new(1, 1, 1)
12ChatFrame.TextStrokeColor3 = Color3.new(0, 0, 0)
13ChatFrame.Font = "ArialBold"
14ChatFrame.Text = player.Name..": "..msg

and here's the UpdateChat function just in case i was too stupid to find out a mistake here

01function UpdateChat()
02if #script.CHATGUI.ChatGUI:GetChildren() > 0 then
03for i,v in pairs(script.CHATGUI.ChatGUI:GetChildren()) do
04v.Position = v.Position + UDim2.new(0, 0, -0.1, 0)
05if v.Position.X.Scale == -1 then
06v.Position = v.Position + UDim2.new(1.01, 0, 0, 0)
07end
08if v.Position.Y.Scale < -0.01 then
09v:Destroy()
10end
11end
12end
13end
14if #script.CHATGUI.ChatGUI:GetChildren() > 0 then
15for i,v in pairs(script.CHATGUI.ChatGUI:GetChildren()) do
View all 24 lines...

Help would be appreciated :D

0
Could you show us the whole script you're having trouble with, along with any and all errors? The second and third script doesn't have a call, and the first is missing variables. More info such as if you're using a local script and where the script is located would be very helpful. Thank you. User#11440 120 — 8y
0
the output shows no errors but ok AdamFunMaker 35 — 8y
0
Its located in workspace and i'm using a normal script AdamFunMaker 35 — 8y

Answer this question