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

Rank only kill script?

Asked by 10 years ago

I am not good with scripting but this is what I tried to make.



local rank = 25,255 -- The rank the player will need to get through (out of 255) local groupID = 1139999 -- The group ID the player must be in script.Parent.Touched:connect(function(hit) if (hit and hit.Parent and game.Players:FindFirstChild(hit.Parent.Name)) then if (game.Players[hit.Parent.Name]:IsInGroup(groupID) and game.Players[hit.Parent.Name]:GetRankInGroup(groupID) == rank) then else human.Health= 0 end end end)

What I wanted the script to do was Kill someone if they weren't in the right rank.

1 answer

Log in to vote
2
Answered by
2eggnog 981 Moderation Voter
10 years ago
local rank = 25 -- The rank the player will need to get through (out of 255)
local groupID = 1139999 -- The group ID the player must be in

script.Parent.Touched:connect(function(hit)
    if (hit and hit.Parent and game.Players:FindFirstChild(hit.Parent.Name)) then
        if (game.Players[hit.Parent.Name]:IsInGroup(groupID) and game.Players[hit.Parent.Name]:GetRankInGroup(groupID) >= rank) then
            --Do nothing
        else
            hit.Parent:BreakJoints()
        end
    end
end)
Ad

Answer this question