Hello there! I am having massive trouble with my ban gui. I'm testing the ban gui and I type a reason (string). I press the ban button which fires a remote event. This error pops up in the output: invalid argument #3 (string expected, got nil). I have no idea how to fix it.
Remote event code:
game.ReplicatedStorage.banPlayer.OnServerEvent:Connect(function(target, reason)
target.Banned.Value = "Yes"
target.banReason.Value = reason
target:Kick(reason)
end)
The error is coming from line 3.
Ban button code:
local playerInput = script.Parent.Parent.PlayerInput
local ReasonInput = script.Parent.Parent.ReasonInput
local targetedPlayer = game.Players:FindFirstChild(playerInput.Text)
local toString = tostring(ReasonInput.Text)
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.banPlayer:FireServer(targetedPlayer, toString)
end)
Any ideas? I would greatly appreciate some debugging with my code. :D
