how can i make a adminbypass (with userid) for this door? All players (not the owner from the tycoon) will get killed if the door is activated. But i want that I (admin) can walk through a activated door. But how can i make that? Can someone edit the script and send it back?
local ownerID = 1240678162
function touc(part)
local plr = game.Players:FindFirstChild(part.Parent.Name)
if plr then
local h = part.Parent:FindFirstChild("Humanoid")
if h then
if val.Value == true then
if part.Parent.Name ~= script.Parent.Parent.Parent.Parent.Parent.Owner.Value.Character.Name then
h.Health = 0
else if part.Parent.UserId == ownerID then
part.Parent:FindFirstChild("Humanoid").Health = 100
end
end
end
end
end
end
script.Parent.Touched:connect(touc)
local ownerID = --ID Here
script.Parent.Touched:Connect(functon(h)
if h.Parent:FindFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(h.Parent).UserId ~= ownerID then
h.Parent.Humanoid.Health = 0
end
end)
local IDs = {ID,ID} -- add IDs here as you please
script.Parent.Touched:Connect(functon(h)
if h.Parent:FindFirstChild("Humanoid") and not table.find(IDs,game.Players:GetPlayerFromCharacter(h.Parent).UserId) then
h.Parent.Humanoid.Health = 0
end
end)
no you didn’t understand. I mean the tycoon owner not the game owner. The script from the door is right but i only want that you add that i can walk through. But dont change the script only add something i think.
Assume that the tycoon’s owner ID was nil from the beginning, the ownership touch brick should change the owner ID to the player who touched it. A secondary check is needed for admins and others.
For a secondary check, use any method to check for if the player’s ID or rank of a group is high enough to bypass the check from killing.
If none of the checks passed, they will be ultimately obliterated by the door.
The idea is to write a table with specific UserIDs of each admin you want to add and then proceed to using table.find(). If it returns nil, it’s not there. Otherwise you can use return to stop the line.