Roblox Scripting Tutorial: Whitelisted (Owner Only) Door using FilteringEnabled

Channel:
Subscribers:
2,110
Published on ● Video Link: https://www.youtube.com/watch?v=AWEnXbJeNfw



Roblox
Game:
Roblox (2006)
Category:
Tutorial
Duration: 12:31
1,439 views
26


I know the title can be a bit confusing, so let me explain. In this tutorial, we use the way that manipulating parts in Workspace from a client makes them appear differently to everyone to make a door that only whitelisted players can pass through, even if other players follow directly behind them.

Server Door Script:
rs = game:GetService("ReplicatedStorage")
event = rs.OpenCloseDoor
allowedPlayers = {"Rrrrry123", "Player1"} - Replace this array with a string value if you prefer.
debounce = false

script.Parent.Touched:connect(function(hit)
if not debounce then
debounce = true
local char = hit.Parent
if char then
if char:findFirstChild("Humanoid") then
local found = false
for index, item in ipairs(allowedPlayers) do
if char.Name == item then
found = true
end
end
if found then
event:FireClient(game.Players:FindFirstChild(char.Name), script.Parent)
end
end
end
wait(1)
debounce = false
end
end)

Client Script:
rs = game:GetService("ReplicatedStorage")
event = rs.OpenCloseDoor

event.OnClientEvent:connect(function(door)
door.CanCollide = false
--Delete the following --s if you want the door to close after the whitelisted player passes through.
--It doesn't really matter, as no one else will be able to get through anyway.
--wait(3)
--door.CanCollide = true
end)

Be sure to follow me on Twitter after subscribing!
https://twitter.com/Rrrrry123

Also, follow me on Twitch for some live streams!
http://www.twitch.tv/Rrrrry123







Tags:
Rrrrry123
RyGuyGaming
Ryan
Roblox
Minecraft
Runescape
PS
PlayStation
Let's
Play
Talk
Nostalgia
HTML
Script
Tutorial
Web
design
Lua
help
Dark
Souls
Destiny
Xbox
Scripting
Gaming
FilteringEnabled
Whitelist
Door
Owner
Only



Other Statistics

Roblox Statistics For RyGuyGaming

At present, RyGuyGaming has 459,946 views spread across 106 videos for Roblox, and roughly a days worth of Roblox videos were uploaded to his channel. This makes up 17.76% of the content that RyGuyGaming has uploaded to YouTube.