Hello everybody!
I have a concern regarding the security of my door system as it stands. Currently, how I plan to remake my door system is when a tool hits a part and the part happens to be my keycard reader, the server accepts it and it fires a remoteevent to the client which is performed with RemoteEvent:FireAllClients.
My main concern is regarding the security of my script, and whether exploiters will be able to grab a tool and open the door without a proper clearance to do so. How will I verify that the player has authorization to use the keycard to prevent people from using the keycard to open doors where they shouldn’t.
This is the Server Script of my old script, if you’d like to refer to it:
local Doors = script.Parent
local DoorA = Doors:WaitForChild("DoorA")
local DoorB= Doors:WaitForChild("DoorB")
local TweenService = game:GetService("TweenService")
local debounce = false
local status = false
local granted = Instance.new("Sound",DoorA)
granted.SoundId = "rbxassetid://200888468"
local opensound = Instance.new("Sound",DoorA)
opensound.SoundId = "rbxassetid://251885495"
local closesound= Instance.new("Sound",DoorA)
closesound.SoundId = "rbxassetid://257841640"
script.Parent.Model1.KeyCardRead.Touched:Connect(function(t)
if t.Name == "Handle" and t.Parent.Name == "Keycard" then
if not debounce then
debounce = true
script.Parent.Model1.Light.BrickColor = BrickColor.Green()
granted:Play()
wait(1)
if status then
closesound:Play()
else
opensound:Play()
end
--script.Parent.Sounds.AccessGranted:Play()
--script.Parent.Sounds.DoorOpen:Play()
TweenService:Create(DoorA.PrimaryPart,TweenInfo.new(1.5),{CFrame=DoorA.PrimaryPart.CFrame*CFrame.new(0,0,status and 2.5 or -2.5)}):Play()
TweenService:Create(DoorB.PrimaryPart,TweenInfo.new(1.5),{CFrame=DoorB.PrimaryPart.CFrame*CFrame.new(0,0,status and -2.5 or 2.5)}):Play()
print("Door Moved")
wait(2)
status = not status
debounce = false
script.Parent.Model1.Light.BrickColor = BrickColor.new("Really red")
end
end
end)
script.Parent.Model2.KeyCardRead.Touched:Connect(function(t)
if t.Name == "Handle" and t.Parent.Name == "Keycard" then
if not debounce then
debounce = true
script.Parent.Model2.Light.BrickColor = BrickColor.Green()
granted:Play()
wait(1)
if status then
closesound:Play()
else
opensound:Play()
end
--script.Parent.Sounds.AccessGranted:Play()
--script.Parent.Sounds.DoorOpen:Play()
TweenService:Create(DoorA.PrimaryPart,TweenInfo.new(1.5),{CFrame=DoorA.PrimaryPart.CFrame*CFrame.new(0,0,status and 2.5 or -2.5)}):Play()
TweenService:Create(DoorB.PrimaryPart,TweenInfo.new(1.5),{CFrame=DoorB.PrimaryPart.CFrame*CFrame.new(0,0,status and -2.5 or 2.5)}):Play()
print("Door Moved")
wait(2)
status = not status
debounce = false
script.Parent.Model2.Light.BrickColor = BrickColor.new("Really red")
end
end
end)