Myself and another have been working with the Trello API. We have figured it all out, but the problem lies with using PlayerAdded. The script works perfectly fine but as soon as we put it into
game.Players.PlayerAdded:Connect(function()
it stops working. If anyone could tell me why or if you’ve experienced this problem, how did you fix it?
I haven’t used trello API for some time, but guessing you’re playtesting this in studio I think its because the trello API takes time to load and properly connect the event before you join. You could test this by maybe using it in a real server (may have the same problem tho) but then you can test by having a friend join and seeing whats happened.
Possibly the API loading time is affecting the timing of the player added event try this:
local Players = game:GetService("Players") -- ROBLOX PLAYERS SERVICE
-- Your function
local function PlayerAdded(Player)
-- Any stuff
end
-- Do the function for the players in the server
for _,v in pairs(Players:GetPlayers()) do
PlayerAdded(v)
end
-- Connect the function for new servers
Players.PlayerAdded:Connect(PlayerAdded)