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
player.Chatted:connect(function(msg)
UpdateChat()
NewChat(player, msg)
end)

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

function NewChat(player, msg)
local ChatFrame = Instance.new("TextLabel", script.CHATGUI.ChatGUI)
ChatFrame.Size = UDim2.new(0.8, 0, 0.1, 0)
ChatFrame.Position = UDim2.new(-1, 0, 0.8, 0)
ChatFrame.TextXAlignment = "Left"
ChatFrame.TextColor3 = Color3.new(1, 1, 1)
ChatFrame.TextStrokeColor3 = Color3.new(0, 0, 0)
ChatFrame.TextStrokeTransparency = 0
ChatFrame.BackgroundTransparency = 1
ChatFrame.FontSize = "Size18"
ChatFrame.TextColor3 = Color3.new(1, 1, 1)
ChatFrame.TextStrokeColor3 = Color3.new(0, 0, 0)
ChatFrame.Font = "ArialBold"
ChatFrame.Text = player.Name..": "..msg

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

function UpdateChat()
if #script.CHATGUI.ChatGUI:GetChildren() > 0 then
for i,v in pairs(script.CHATGUI.ChatGUI:GetChildren()) do
v.Position = v.Position + UDim2.new(0, 0, -0.1, 0)
if v.Position.X.Scale == -1 then
v.Position = v.Position + UDim2.new(1.01, 0, 0, 0)
end
if v.Position.Y.Scale < -0.01 then
v:Destroy()
end
end
end
end
if #script.CHATGUI.ChatGUI:GetChildren() > 0 then
for i,v in pairs(script.CHATGUI.ChatGUI:GetChildren()) do
v.Position = v.Position + UDim2.new(0, 0, -0.1, 0)
if v.Position.X.Scale == -1 then
v.Position = v.Position + UDim2.new(1.01, 0, 0, 0)
end
if v.Position.Y.Scale < -0.01 then
v:Destroy()
end
end
end

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