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

How do I make a block kill players in a certain group?

I have made this script but it does not seem to work can anyone help me?

Block = script.Parent 
if game.Player:groupid = -- Group id
function Kill(part) 

	local Player = part.Parent 
	local Torso = Player.Torso 

	Torso:Destroy() 

end 

Block.Touched:connect(Kill) 

1 answer

local block = script.Parent
local groupid = --group id

game.Players.PlayerAdded:Connect(function(player)
	if player:IsInGroup(groupid) then
		block.Touched:Connect(function(hit)
			player:GetPlayerFromCharacter(hit.Parent)
			if hit.Parent then
				player.Character.Head:BreakJoints()
			end
		end
	end
end)

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