Hello. I'm getting an error of 12:20:25.932 - Players.SilverCreeper58.PlayerGui.CustomChat.ChatFrame.ChatBar.TriggerChatSend:16: attempt to call method 'Clone' (a nil value)
. I don't understand how you can fix this.
Here's the Script (regular):
plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() char = plr.Character or plr.CharacterAdded:Wait() plrgui = plr.PlayerGui or plr.WaitForChild("PlayerGui") chatbox6 = script.Parent.Parent.MsgChatFrame.chatbox6 script.Parent.msgbar.FocusLost:Connect(function(enter) if enter then script.Parent.Parent.MsgChatFrame.chatbox1.Text = script.Parent.Parent.MsgChatFrame.chatbox2.Text script.Parent.Parent.MsgChatFrame.chatbox2.Text = script.Parent.Parent.MsgChatFrame.chatbox3.Text script.Parent.Parent.MsgChatFrame.chatbox3.Text = script.Parent.Parent.MsgChatFrame.chatbox4.Text script.Parent.Parent.MsgChatFrame.chatbox4.Text = script.Parent.Parent.MsgChatFrame.chatbox5.Text script.Parent.Parent.MsgChatFrame.chatbox5.Text = script.Parent.Parent.MsgChatFrame.chatbox6.Text script.Parent.Parent.MsgChatFrame.chatbox6.Text = script.Parent.msgbar.Text script.Parent.msgbar.Text = "Tap the \"/\" button or click here to chat" chatbox6.Text = " "..char.Name..": "..chatbox6.Text script.Parent.Parent.MsgChatFrame.chatbox1.Text:Clone().Parent = plrgui.CustomChat.ChatFrame.MsgChatFrame.chatbox1.Text script.Parent.Parent.MsgChatFrame.chatbox2.Text:Clone().Parent = plrgui.CustomChat.ChatFrame.MsgChatFrame.chatbox2.Text script.Parent.Parent.MsgChatFrame.chatbox3.Text:Clone().Parent = plrgui.CustomChat.ChatFrame.MsgChatFrame.chatbox3.Text script.Parent.Parent.MsgChatFrame.chatbox4.Text:Clone().Parent = plrgui.CustomChat.ChatFrame.MsgChatFrame.chatbox4.Text script.Parent.Parent.MsgChatFrame.chatbox5.Text:Clone().Parent = plrgui.CustomChat.ChatFrame.MsgChatFrame.chatbox5.Text script.Parent.Parent.MsgChatFrame.chatbox6.Text:Clone().Parent = plrgui.CustomChat.ChatFrame.MsgChatFrame.chatbox6.Text end end)
This just checks if the player has pressed enter. Then when the message goes through, all the messages go up by one chatbox space. After that, it "should" clone them and put it in the PlayerGui.
Yes I know... it doesn't look the best, but whatever. This is the script. I know it has something to do with lines 16 - 21.
you are attempting to clone a string value held in the Text property of your textbox. Then you attempt to set it's parent to another text value. Remove ".Text"
also, use a for loop for this, please..
for i = 1, 6 do local myChatBox = script.Parent.Parent.MsgChatFrame:FindFirstChild("chatbox"..i") local b = plrgui.CustomChat.ChatFrame.MsgChatFrame:FindFirstChild("chatbox"..i") myChatBox:Clone().Parent = b end