i am making a game where if you press the wrong gui button, you will get kicked out. I tried both local and server scripts. This is my script:
script.Parent.MouseButton1Click:Connect(function(plr)
local player = game.Players:GetPlayerFromCharacter(plr)
player:Kick("Wrong Answer. Please try again.")
end)
I may be stupid and I probably shouldn't use GetPlayerFromCharacter. This is the error in the output:
19:56:20.510 - Players.RealJefff2000.PlayerGui.ScreenGui.question1.answer2.Script:3: attempt to index nil with 'Kick'

1 comment
There are no parameters provided by the MouseButton1Click signal