One of the most frequent mistakes made with an error such as this one is that the script fails to locate an object that hasn't been completely loaded into the game yet upon startup. Consider using the WaitForChild
function to allow the script to wait until a certain object has been loaded properly.
Another mistake I found in the script that you may want to be aware of is contained within lines 34 - 38. You attempt to compare string values with mathematical operators, which will cause another error.
You can convert the strings to number values with the use of tonumber
, or you can simply fix the issue by removing the secondary if statement since you are necessarily needing only one condition to be met for the script to continue running.
MINOR EDIT: You may also want to consider changing the name for "Name", as it may confuse the script with the object's actual name.
05 | ap = require(game.Workspace.TrelloAPI) |
07 | ListID = ap:GetListID( "Computer Logins" ,BoardID) |
10 | local player = script.Parent.Parent.Parent.Parent.Parent |
11 | local userid = player.UserId |
12 | local placeid = game.PlaceId |
14 | script.Parent.MouseButton 1 Click:connect( function () |
18 | local Main = script.Parent.Parent |
19 | local Rank = Main:WaitForChild( "Rank" ).Text |
20 | local Name = Main:WaitForChild( "Name" ).Text |
21 | local Code = Main:WaitForChild( "Code" ).Text |
23 | script.Parent.Text = "Please wait" |
25 | CardID = ap:AddCard( "Computer Login By: " ..(player.Character.Name).. " || ID: " ..(userid), "**Rank:** " ..Rank.. "\n\n**Name:** " ..(Name).. "\n\n**Entered Code:** " ..(Code).. "" ,ListID) |
29 | script.Parent.Parent.Parent [ "Windows Frame" ] .Visible = true |
32 | Code = "Incorrect code" |
If you have any questions about the answer I provided, please message me back and I'll be happy to clear it up for you. Thanks.