I have previously made a post about this topic that went without a helpful answer (I removed the Question due to this) as to why the script was doing what it was doing, or how I could fix it. The suggestion was to use MouseButton2Click... -_-
Whenever I try to run the message command for the script, when I run it again the command always repeats. Say I run the command once, then it runs once. Except when I run it twice, it runs twice at the same time, same for the third, fourth, fifth, etc. times.
I honestly do not see why the command repeats, and I would like some helpful answer to how to fix this, and what is going wrong. Here is the function for the message command, the command works, except it still has that repeat I do not want.
local core = script.PACCore
--More code, nothing affecting function of problem.
local corclone = core:Clone()
--More code, nothing affecting function of problem.
local data = corclone.Frame.Data
--More code, nothing affecting function of problem.
data.Commands['Message'].MouseButton1Click:connect(function()
data.Commands:TweenPosition(UDim2.new(1, 35, 0, 20), "Out", "Linear", 3/4)
wait()
data.TextInput.Visible = true
data.TextInput:TweenPosition(UDim2.new(0, 35, 0, 20), "Out", "Linear", 3/4)
wait()
info.TextLabel.Text = "M:Message"
info:TweenPosition(UDim2.new(0, 0, 0, -10), "Out", "Linear", 1)
data.TextInput.Confirm.MouseButton1Click:connect(function()
if script:FindFirstChild("Message") then
for _,v in pairs(game:GetService("Players"):GetChildren()) do
coroutine.resume(coroutine.create(function()
local m = script.Message:Clone()
m.Frame.Body.Msg.Text = data.TextInput.TextBox.Text
m.Frame.Header.Head.Text = corclone.Parent.Parent.Name
m.Parent = v:WaitForChild("PlayerGui")
wait()
m.Frame.Script.Disabled = false
end))
end
else
local m = Instance.new("Message",game:GetService("Workspace"))
m.Text = corclone.Parent.Parent.Name .. ": " .. data.TextInput.TextBox.Text
game:GetService("Debris"):AddItem(m, wait((m.Text:len()/13)+1))
end
table.insert(logs, 1, GetTime() .. " - " .. corclone.Parent.Parent.Name .. " messaged, ".. data.TextInput.TextBox.Text)
data.Commands.Position = UDim2.new(-1, 35, 0, 20)
data.TextInput:TweenPosition(UDim2.new(1, 35, 0, 20), "Out", "Linear", 3/4)
wait()
data.Commands:TweenPosition(UDim2.new(0, 35, 0, 20), "Out", "Linear", 3/4)
wait()
info:TweenPosition(UDim2.new(0, 0, -1, -10), "Out", "Linear", 1/2)
coroutine.resume(coroutine.create(function() wait(1) data.TextInput.Position = UDim2.new(-1, 35, 0, 20) data.TextInput.Visible = false end))
error("Message Command Finished")
end)
end)
I would appreciate help with fixing where the script is going wrong, or some clue as to why the function keeps repeating. Thank you.
If you would like to see the issue yourself you can take a look at it in Test Site, the Message command is the only one I have coded so far. Once again, I would appreciate some help, and thank you in advance.

1 comment
Wait, I figured it out, let me post in to the answer field.