I made the variable to search for the door then im stuck on how to make the transparency set to .5 then the CanCollide false. So basically this?
Local Door = script.Parent ????????? ????
I made the variable to search for the door then im stuck on how to make the transparency set to .5 then the CanCollide false. So basically this?
Local Door = script.Parent ????????? ????
Assuming you already have the ClickDetector object inside of the door:
Hello!
So basically, you need to use this:
-- IN A SERVER SCRIPT, INSIDE OF THE DOOR --
local door = script.Parent -- door variable
local cD = script.Parent.ClickDetector -- click detector
local event = game.ReplicatedStorage.Clicked -- This will be used to make the door LOCAL, so that people cannot get through with their friends.
cD.MouseClick:Connect(function(player) -- gets the player after a click
event:FireClient(player, door) -- fires onto client
end)
-- IN A LOCALSCRIPT, IN STARTERPLAYERSCRIPTS --
local event = game.ReplicatedStorage:WaitForChild("Clicked") -- gets the event
event.OnClientEvent:Connect(function(door) -- when the event is fired
door.CanCollide = false -- canCollide false
door.Transparency = 0.5 -- transparency 0.5
wait(1) -- change to whatever you'd like
door.Transparency = 0 -- transparency = 0
door.CanCollide = true -- canCollide true
end)
Hope this works!
that seems very in depth max, is there a shorter version?
There could be, this is just "visually in-depth." Really all it's doing is asking it's "friend", if you will, to open a door for this player. Glad I could help! :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
is the door a Model, or a singular part?
http://idownvotedbecau.se/noattempt/
a singular part
Did you try a different way?