Help With Kick Script

I’m new to scripting and need help making a kick script I’ve tried different parameters and stuff but I can’t figure it out.

-Here’s The Script

local finishLine = game.Workspace.FinishLine

finishLine.Touched:Connect(function(Touched, Player)
local char = Touched.Parent
local humanoid = char:FindFirstChildWhichIsA(“Humanoid”)

if humanoid then
	humanoid:Kick()
end

end)

The error is: Kick is not a valid member of Humanoid “Workspace.WindyTundra.Humanoid” - Server - KickScript:8

1 Like

:Kick() is a method of player not humanoid try this instead

local finishLine = game.Workspace.FinishLine

finishLine.Touched:Connect(function(Touched)
	local char = Touched.Parent
	local player = game.Players:GetPlayerFromCharacter(char):
	
	if player then
		player:Kick()
	end
end)
5 Likes

thanks for helping me figure this out!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.