✓ Accepted answer
For starters, GetPlayerFromCharacter() should do the trick instead of that function up there.
`local hum = part.Parent:FindFirstChild("Humanoid")
It's quite a old tactic, but it would do the trick for checking if the touch is still a player's character and not some random part, as .Touched sometimes is buggy like that.
if hum then
local player = game.Players:GetPlayerFromCharacter(part.Parent)`
`
if player:GetRankInGroup(groupid) <= 11 then
end
Obviously there's a lot of other ways of doing hum, I just used that because it's been a method for years, I wouldn't use it for much now a days, but I figured I'd use it as an example of how you could redo a bit of the code.
Obviously if you need more than 1 group, you can use a table instead of that plain old if statement as well.
5 comments
Could you explain the issue you're having
It doesn't seem you've provided an attempt... which makes it a request even if you claim it is not.
Exactly. Show something you tried @RookPvPz
this is a request, im so rebel
Are you using a free script?