So, I'm creating a system like Roblox Anti-Exploit/Roblox Developer Services, and I have a RemoteFunction inReplicatedStorage called 'Call'.
Here's the code from my ModuleScript:
function callESAE(name,id,desc)
local rep = 'yay'
--http stuff yeye
--Insert trello API code
--responce
if rep == 'yay' then
sendMsg("Call System","Your call to ESAE has been sent.\nPlease wait, an agent will be with you shortly.",player,true) --title, body, player, canClose
elseif rep == 'l01a was here' then
sendMsg("Call System","You allready have a pending EASE call.\nYour call has not been sent.",player,true) --title, body, player, canClose
elseif rep == 'bad boi' then
sendMsg("Call System","You have been banned from calling ease.\nYour call has not beens sent.",player,true) --title, body, player, canClose
elseif rep == 'crosstect is here' then
sendMsg("Call System","The game you are playing has been blacklisted from calling ESAE.\nYour call has not been sent.",player,true) --title, body, player, canClose
else
sendMsg("Call System","An unkown error has occoured, please contact ElmEditor.\nYour call has not been sent.",player,true) --title, body, player, canClose
end
end
--
function alert.OnClientInvoke(player,desc)
callESAE(player,desc)
end
And here is the code in my local script (I have defined what theRemoteFunction is with WaitForChild)
reqframe.Submit.MouseButton1Click:connect(function()
local reason = reqframe:WaitForChild("Reason")
cevent:InvokeClient(tostring(reason.Text)) --This is line 267
end)
And here's the error:
10:18:39.781 - Unable to cast value to Object 10:18:39.781 - Script 'Players.Player.PlayerGui.ES_CmdUtl.Client', Line 267 10:18:39.782 - Stack End

5 comments
Thanks, I will try that out
Damn. When I get ninja'd by you editing in an actual bit of code and the error whilst I'm writing my answer.
I'm not going to accept this as the answer until I can prove that it is working. As there are no errors, so I am going to get it to print if it worked. Once again, thanks for the answer.
It might not work, but it's definitely the reason. It might not work because in honesty your logic and code is poorly considered.
It worked, thanks for the answer.