local config = script.Parent.Configuration script.Parent.Touched:connect(function(part) if part.Parent and Game:GetService('Players'):GetPlayerFromCharacter(part.Parent) then local player = Game:GetService('Players'):GetPlayerFromCharacter(part.Parent) if player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value then script.Parent.CanCollide = false if player.grouprank = false then player.Humanoid.Health = 0 if player.Username = "noob1126" then player.humanoid.Health = 100 wait(1) script.Parent.CanCollide = true end end end)
This does not work. I am trying to make it so me and group members above a certain rank can enter and if the door is open for a brief second and you're are not in the group rank > above or me then you die. Attached to this is the configurartion folder and the group part works so I just need the "Kill when open" so when door.CanCollide = false, and adding my name in there so I dont die.
~Thanks a ton for the help, Noob1126
In line 8 and 9, you tried accessing imaginary properties. Also, you made a few capitalization errors.
local config = script.Parent.Configuration script.Parent.Touched:connect(function(part) if part.Parent and Game:GetService('Players'):GetPlayerFromCharacter(part.Parent) then local player = Game:GetService('Players'):GetPlayerFromCharacter(part.Parent) if (player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value) then script.Parent.CanCollide = false wait(1) script.Parent.CanCollide = true if player.Name:lower() == "noob1126" then player.Character.Humanoid.Health = 100 end else --if not player:IsInGroup(config.GroupId.Value) then player.Character:BreakJoints() -- Same as killing --end end end end)