Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-3

How do you fix this door? [closed]

Asked by 9 years ago

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?

0
You are going to need to make this have Lua formatting for the code and to space out the lines because I can barely read that VariadicFunction 335 — 9y
2
This would fall into the category of a request, since you admitted to not knowing a thing about coding. It's basically asking for free scripts. This site is for improving one's coding skill. Perci1 4988 — 9y

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?

1 answer

Log in to vote
0
Answered by
bobder2 135
9 years ago

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.

Ad