Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Unable to cast string to int?

So from the following script, I get the error,

Unable to cast string to int Script 'Players.Player.PlayerGui.FeedbackGui.FeedBackFrame.Enter.Script', Line 13

ap = require(script.Parent.Parent.Parent.TrelloAPI)  

local Board = ap:GetBoardID("Feedback")

local List = ap:GetListID("Recieved",Board)

local isOwner = false

local id = script.Parent.Parent.TextFrame.TextBox.Text

local player = script.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Down:connect(function()
	--------------------------------------ERROR HERE-----------------
	if player:IsInGroup(id) and player:GetRankInGroup(id) == 255 then
		isOwner = true
	end
	-------------------------------------------------------------------------
					--[Name],[Decription],[List ID]
		ap:AddCard(id,"Sent by: "..game.Players.LocalPlayer.Name,List,"","top")
		script.Parent.Parent.TextFrame.TextBox.Text = "Enter ID here..."
		
		if isOwner == true then
			local GCI = ap:GetCardID(id,Board)
			ap:AddCardLabel(GCI,1)
		else
			local GCI = ap:GetCardID(id,Board)
			ap:AddCardLabel(GCI,4)
		end
end)

1 answer

✓ Accepted answer

Just replace .Text from the variable to line 14 if player:IsInGroup(id.Text) and player:GetRankInGroup(id.Text) == 255 then

1 comment

0

In addition, replace line 9 with local id = script.Parent.Parent.TextFrame.TextBox

This discussion is preserved as it was. New answers, comments, and votes are closed.