Hello, I posted about this yesterday and got some assistance but I am once again stuck with my script. I'm more confused than before but I think I am closer to the solution than I was before.
Here is what I want to do:
Player picks up a key from the ground which gives them a tool called "Golden Key" (done) Player touches their key tool to the door which is a part called "GoldenLock" - which then opens the door for only them. (Problems occur here)
Overall, I want 4 tool keys that a player physically holds up to 4 doors layered onto each other, which I plan on unioning individually (as in, 1 door for 1 key) and making them like "chains" for the real door behind them, so as each one disappears, one lock for the door will go away until finally they are allowed to pass through. I would likely layer 4 "locks" on top of each other and using the scripts below, just individually have them become cancollide = false and transparency = 1.
Hopefully this explanation makes sense, I may be rambling a little bit but I just wanted to fully explain my objective here.
Here are my scripts, they are likely very wrong as I am uncertain of how to do a lot of things with remote events...
Local Script, located in StarterPlayer.StarterCharacterScripts
local RemoteEvent = game.ReplicatedStorage.RemoteEvent
door = game.Workspace.GoldenLock
COOLDOWN_TIME = 1
cooldown = false
RemoteEvent.OnClientEvent:Connect(function()
local function onTouch(p)
if p.Parent.Name == "Golden Key" then
if cooldown then
return
end
cooldown = true
door.Transparency = 0.5
door.CanCollide = false
wait(3)
door.Transparency = 0
door.CanCollide = true
wait(COOLDOWN_TIME)
cooldown = false
end
end
end)
Server Script, located in ServerScriptService
local RemoteEvent = game.ReplicatedStorage.RemoteEvent
RemoteEvent.OnServerEvent:Connect(game.Player.userId)
I kept on tinkering with the scripts and every time I thought I figured out the solution, I kept on getting errors and continued to change things until I just kind of came to this mess. I don't even know if this is right, but I think I may be somewhat on the right track.. I don't know if I need to get a unique user for each player that contacts the door, but the way to activate the door is through the key the player is holding. Is this even possible to do for only one client, or is it doomed because the key would technically be server side? Or is it possible because it's a part of the player's individual backpack?
Any assistance I could receive would help immensely, I only completed some scripting lessons from Studio+ about a week ago and had some issues retaining all of the info. I don't want to find a workaround for this so that I may learn from this and become better at scripting. If you have read all of this, thank you very much.

2 comments
Woah you joined 2008.
@ivvSnooxy - Yes, I came back after being gone since about 2012 to learn programming and try to make some high quality games if possible.