So I am making a booking GUI to book tables etc, when the Submit button is clicked, it doesn’t fire the Remote Event in Replicated Storage, to test it, when it fires it is meant to print out “Fired”, but it doesn’t.
local Trello = require(script.Parent.Trello.Main)
local MainBoard = Trello:GetBoardByName("Redacted")
local Bookings = MainBoard:GetListByName("Bookings")
function getbookings() -- This Works
local bookings = Bookings:GetCards()
for i,v in pairs (bookings) do
local new = Instance.new("StringValue")
new.Parent = game.ReplicatedStorage.Bookings
new.Name = v:GetName()
new.Value = v:GetDesc()
print("Server Running") -- This Works
getbookings() -- This Works
while true do -- This Works
if Message == "make" then
local book = Trello.new("Card", "Test", Bookings)
book:SetDesc("Card made by: "..Player.Name.."\nTime: Test\nTable: 1")
game.ReplicatedStorage:WaitForChild("book").OnServerEvent:Connect(function(p, plr, tablee, timee)
local book = Trello.new("Card", plr, Bookings)
book:SetDesc("Booking made by: "..p.Name.."\nTime: "..timee.."\nTable: "..tablee.."")
while loops are blocking; they will yield the thread (script) until they complete the condition (this being true; meaning it will run forever).
Consider using courontines, a schedular, or move the while loop to the bottom of the code.
FWIW you also shouldn’t use Trello as a database; there’s a few other code smells but since it’s OT I’ll leave it to someone else to explain (feel free to DM me if you’d like more genera feedback on your code)