Well, I am making a request system where when you type something into a UI, it will show it onto a scrolling frame surface gui.
It isn’t really working, nor printing anything, could anybody help?
This really isn’t a popular thing that people would script so found no help on the DevForum so far.
Hope you can help!
local player = game.Players.LocalPlayer
local debounce = false
script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
script.Parent.Parent.TextButton.MouseButton1Click:Connect(function(player)
if debounce == false then
debounce = true
local clone = game.Workspace.Part.SurfaceGui.Frame.ScrollingFrame.TextLabel1:Clone()
clone.Text = (player.Name.."Has Requested a"..script.Parent.Text)
end
end)
end)
if debounce == true then
wait(15)
debounce = false
end```
the wrong here is that you are not setting it inside the if debounce was false statement set it inside and it’ll work also I recommend not putting events inside of events
Maybe this (note that the Script works fine for me when I tested it on Baseplate without cloned part):
local player = game.Players.LocalPlayer
local debounce = Instance.new("BoolValue")
debounce.Name = "debounce"
debounce.Parent = script
script.Parent.Parent.TextButton.MouseButton1Click:Connect(function(player)
if not debounce.Value then --Means basically if debounce.Value == false then
debounce.Value = true
local clone = game.Workspace.Part.SurfaceGui.Frame.ScrollingFrame.TextLabel1:Clone()
clone.Text = (player.Name.."Has Requested a"..script.Parent.Text)
end
end)
debounce.Changed:Connect(function()
if debounce.Value then
wait(15)
debounce.Value = false
end
end)