|
| 27 Nov 2013 03:43 AM |
My door contains more then "One Brick". I've had to make it into a "Model". Is there a way to make this door clickable even though it's made out of multiple of bricks??
I did try this script out but assuming this only works for one brick?
local cf = script.Parent.CFrame
function onClicked() if script.IsOpened.Value == false and script.IsOpening.Value == false then script.IsOpening.Value = true for i = 1,16 do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, -0.18) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) wait(0.01) end script.IsOpening.Value = false script.IsOpened.Value = true elseif script.IsOpened.Value == true and script.IsOpening.Value == false then script.IsOpening.Value = true for i = 1,16 do script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, 0.1, 0) * CFrame.new(0, 0, 0.18) wait(0.01) end script.IsOpening.Value = false script.IsOpened.Value = false script.Parent.CFrame = cf script.CloseSound:Play() end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
This script does work but I need it to work for a "Model". which contains more than one brick.
-Ash |
|
|
| Report Abuse |
|
|
| 27 Nov 2013 03:59 AM |
| Put the bricks in a model and do the door part of the script in a generic for. |
|
|
| Report Abuse |
|
|
| 27 Nov 2013 05:41 AM |
Could you explain more?:)
I'm not a scripter so I don't know half of this stuff.. I'm only on here to build and be creative.
-Ash |
|
|
| Report Abuse |
|
|
| 27 Nov 2013 01:48 PM |
Anymore suggestions or guidance?:)
-Ash |
|
|
| Report Abuse |
|