Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Kill a certain named player? (SOLVED IT)

I need help. I want this script to kill a player with a certain name when he touches a part. My script isn't working, there aren't any errors and the "1" prints fine.

local name = "Just_T0m"
script.Parent.Touched:Connect(function(hit)
	
	if hit.Parent:FindFirstChild("Humanoid") then
		print("1")
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		local character = hit.Parent
		
		if player.Name == name then
			--
		end
	end
end)

1 answer

The solution was adding the actual kill function lol

script.Parent.Touched:Connect(function(hit)
	
	if hit.Parent:FindFirstChild("Humanoid") then
		
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		local character = hit.Parent
		local name = "Just_T0m"
		
		if player.Name == name then
			hit.Parent:BreakJoints()
			
		end
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.