Please help me, it's doing an "Index" error and I don't know how to fix it.

game.ReplicatedStorage.kickEvent.OnServerEvent:Connect(function(hit)
	local playerDS = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
	local playerGui = playerDS.PlayerGui
	local textBox = playerGui.desktopGUI:WaitForChild("/kick").TextBox
	local playerUser = game.Players:WaitForChild(textBox.Text)
	playerUser:Kick("Thanks for playing Mini Ware!")
end)

4 comments

0

i'm pretty sure you can only kick players locally

0

@ryan32t That isn't true, however the person who asked this question needs to specify the exact error and lines. This is not enough information to help him, and there are several problems with the script

0

I actually got it to work, but I'm using a script and it's saying that the textbox.text is "".

0

@Ha_rriz please specify the error and on what lines you are getting. You need more details in your question because currently it is hard to see what you are asking, and how to assist you.