So here is another update on my citation system. It doesn’t work as comes up with the error " is not a valid member of players “Players”". Why is this? Someone help?
local recipient = script.Parent.Parent.playername.Text
local reason = script.Parent.Parent.reason.Text
local amount = script.Parent.Parent.amount.Text
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Citation.AddCitation:FireServer(recipient,reason,amount)
script.Parent.Parent.Visible = false
end)
I am passing the reason why the citation was submitted (reason), the person who is going to recieve the citation (recipient), and the amount to be payed.
You immediately were retrieving the Text from all of the textboxes, if you had nothing in that textbox, it would return nil into those variables. Reference the text when it needs to be references. Also I recommend adding an if statement before all the code in your RemoteEvent since it’ll error if a player was not found, I recommend after the wait(.8) that you do if not game.Players:FindFirstChild(recipient) then return end to not continue if a player with the name was not found
Also if my post was the solution, it’s best to mark it as the solution so others will know that the post has been solved