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

3 comments
Thank you soooooo much! this really helped me, I am new at scripting so this help really does help.
Glad I could help!
Oh yeah forgot to ask you, if someone touches this and it is NOT open, will it kill them? Cause I was hoping no.