wait(1)
local event = nil;
local name = nil;

event.OnServerEvent:Connect(function()
	for _,plr in pairs(game.Players:GetPlayers()) do
			print("Running Sources")
		event = plr:WaitForChild("PlayerGui").CoreGui.KickPlayer:WaitForChild("Remote Kick")
		repeat
			 wait()
		until
			event
		name = event.Parent:WaitForChild("PlayerName")
	print("a")
	if game:FindFirstChild(name.Text) then
		print("b")
		game.Players[name.Text].Character:Remove()
		print("c")
		wait()
		print("d")
		game.Players[name.Text].PlayerGui.CoreLoadingGui.Error.Visible = true
		print("e")
		game.Players[name.Text].PlayerGui.CoreLoadingGui.Error.ErrorText.Text = "[ CLIENT DISCONNECTED ]: You have been kicked from this game."
		print("f")
		end
	end
end)

8 comments

0

because you set the variable "event" nil ;-;

0

That is not the reason, I could set local nil and it still would give me the error.

0

"event" is nil because you said "event = nil" and didn't set it to something that's not nil

0

Uhhh, because event is nil at the start and you're attempting to use it

0

Line 8

0

16:22:00.986 - ServerScriptService.Event Reciever:5: attempt to index local 'event' (a nil value)

0

"local event = nil" therefore it will return nil

0

Oh my gosh... I feel so dumb