of     1   

KingCamembert
#141745707Sunday, July 27, 2014 6:17 PM GMT

Okay so I want that when the player clicks the clickdetector part called "Button1", the part called "Door1" is destroyed. I then want it to wait 6 seconds to clone it and put it back in place. Is this script correct : local CD = script.Parent local function onMouseClick(Player) local brick:IsA("Door1") then game.workspace.Door1.void destroy() wait(6) Door1.void clone()
KingCamembert
#141826699Monday, July 28, 2014 9:56 AM GMT

b1
plistra
#141826767Monday, July 28, 2014 9:58 AM GMT

Did you create a new instance of a click detector already, or no? Did you call your function?
KingCamembert
#141826909Monday, July 28, 2014 10:03 AM GMT

I added a clickdetector from basic objects, is thart what you mean ? Also was I supposed to add a function at the beginning ?
RoAnt
#141826960Monday, July 28, 2014 10:05 AM GMT

local CD = script.Parent --[[hopefully you put this script inside a "ClickDetector" and that the "ClickDetector" is inside a part, the button.]] local door1_cloning = game.Workspace.Door1:clone() bool = true local function onMouseClick(Player) if bool then bool = false game.Workspace.Door1:Destroy() wait(6) door1_cloning:clone().Parent = workspace wait(1) bool = true end end CD.MouseClick:connect(onMouseClick)
cody123454321
#141827811Monday, July 28, 2014 10:35 AM GMT

-- our resources local detector = script.Parent local model = game.Workspace.Door1 -- clone and state local clone = model:Clone() local state = false -- remove the model and replace it to resolve it to a variable model:remove() local inst = clone:Clone() inst.Parent = Workspace -- setup hook for mouseclick. detector.MouseClick:connect(function(plr) if(state)then state = false inst = inst:Clone() inst.Parent = Workspace else state = true inst:remove() end end)
cody123454321
#141827857Monday, July 28, 2014 10:37 AM GMT

-- our resources local detector = script.Parent local model = game.Workspace.Door1 -- clone and state local clone = model:Clone() local state = false -- function to make our door function makeDoor() local inst = clone:Clone() inst.Parent = Workspace end -- remove the model and replace it to resolve it to a variable model:remove() local inst = makeDoor() -- setup hook for mouseclick. detector.MouseClick:connect(function(plr) if(state)then state = false inst = makeDoor() else state = true inst:remove() end end)

    of     1