Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Door being unlocked for all the clients, but not the server itself?

I made a key and a door script. I'm using a local script that is in StarterPlayerScripts. But, when the key touches the door. It works fine, the only issue is that it unlocks for everyone. Making it so everyone can walk through the door. And also not only that, the server sees the door itself as closed.

local SPS = script.Parent
local here = game.Workspace["House!"].Diningroom.Door

local function touch(p)

		if p.Parent.Name == "Key1" then
			here.Transparency = 0.5
			here.CanCollide = false
			end
end

here.Touched:Connect(touch)

So does that mean I would need to use something like a remote event, so it can fire on one client instead on all of them?

2 answers

You can try doing OnClientEvent using a RemoteEvent here is an example:

RemoteEvent.OnClientEvent:Connect(function(returnedData)
	--put your door script lines in here
end)

hope this helps! Keep noted that i'm NOT good at remote events so this is just an Attempt in helping.

1 comment

0

Alright, I'll be sure to try this out tomorrow. And if it doesn't work, thanks anyway and I'll try SteelMettle1's idea and learn about collision filtering

This discussion is preserved as it was. New answers, comments, and votes are closed.