Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Kills player on touch script if not a rank?

Asked by 6 years ago

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?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
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.

0
The script doesn't actually kill the player ontouch, LordSqaureAlistair 3 — 6y
Ad

Answer this question