The script I have isn't working and I'm unsure of how to change it. The script needs to be killing someone ontouch if not a rank in the group. Does anybody know if they have a script like that?
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.