I’m scripting a local script for a citation system and I want the “person” textbox to find the person’s username in the game.
Error
Argument 1 missing or nil - Client - Client:8 12:42:53.711 Stack Begin - Studio 12:42:53.711 Script 'Players.LMVM2041.PlayerGui.Citation.Main.Client', Line 8 - Studio - Client:8 12:42:53.711 Stack End - Studio
Code
local event = game.ReplicatedStorage.Cite
local players = game:GetService("Players")
script.Parent.Submit.MouseButton1Click:Connect(function(plr)
local amount = script.Parent.AmountDue.Text
local suspect = script.Parent.Name.Text
if players:FindFirstChild(suspect) then
print("Suspect found!")
event:FireServer(suspect, amount)
end
end)
Error line in code
if players:FindFirstChild(suspect) then
Can anybody help?