Hello, I can't script at all, but my friend made a door that was supposed to be opened when clicked. Can you please, please fix it for me dear helpers?
team = game.Teams.OfficeStaff -- Put team name here player = "Player1" door = script.Parent function onClicked() if script.Parent.ClickDetector.MouseClick == player then door.CFrame = door.CFrame * CFrame.new(0, 0, 1)
end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--[Made by AgentL3r]--
Can you please fix it for me/him?
Even though this is a request I'll help to fix it anyways.
team = game.Teams.OfficeStaff -- This line doesn't do anything but I'll leave it in case you need it. player = "Player1" --Set this line to your name, or use the other section of code below to let everyone use the door. door = script.Parent function onClicked() if script.Parent.ClickDetector.MouseClick == player then door.CFrame = door.CFrame * CFrame.new(0, 0, 1) end end script.Parent.ClickDetector.MouseClick:connect(onClicked) --[Made by AgentL3r with a small edit from bobder2]--
This one will work for anyone:
team = game.Teams.OfficeStaff -- This line doesn't do anything but I'll leave it in case you need it. door = script.Parent function onClicked() door.CFrame = door.CFrame * CFrame.new(0, 0, 1) end script.Parent.ClickDetector.MouseClick:connect(onClicked) --[Made by AgentL3r with a small edit from bobder2]--
Neither of these two sections of code will close the door, I'll let you and your friend figure that out on your own, it's not too hard just take a look at this code and at the roblox wiki.
Closed as Not Constructive by Perci1, NotsoPenguin, and BlueTaslem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?