So. I'm trying to get a damage script where you hit a brick, but if you are in a group with a certain rank or you've got a certain name, you aren't damaged, but if you aren't, you get a 5 damage. But I keep getting errors with the "GetRankInGroup" part..
local Auth = {
["TheHospitalDev"] = true,
["MrOwls"] = true,
["Player"] = true,
["Player1"] = true
}
local g = 2711620
local r = 252
local Damage = 5
script.Parent.Touched:connect(function(hit)
print(hit.Name)
if hit.Parent.Name[Auth] or hit.Parent:GetRankInGroup(g) >= r then
print("Safe")
else
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - Damage --Not sure if I subtracted correctly
print("Damaged by: "..Damage)
end
end)
Left Leg -- Part that touches
23:02:10.049 - GetRankInGroup is not a valid member of Model
23:02:10.049 - Script 'Workspace.Union.Script', Line 13
23:02:10.051 - Stack End
