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

Kills player on touch script if not a rank?

1 answer

script.Parent.Touched:connect(function(hit) --calling touched function when brick is touched
	local hum = hit.Parent:FindFirstChild("Humanoid")
	if hum ~= nil then -- checking to make sure that whatever hit the brick is a player
		local rank = game.Players[hit.Name]:GetRankInGroup(groupid) --getting players rank in group
		if rank == "" then -- replace with whatever rank in group (1-255)
			print("blablabla")
		end
	end
end)

code will look something like that (haven't actually tested this myself in game so apologies if it doesn't work.)

please note that rank and role are separate things, the rank is the ID of the rank, so owner would be 255, and role (GetRoleInGroup(groupid)) returns the actual name of the rank.

1 comment

0

The script doesn't actually kill the player ontouch,

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