#combine these please

21 messages · Page 1 of 1 (latest)

dire meadow
#

can someone make it so that once the click detector is clicked, it will turns off the collisions of a part named "ButtonDoor" and turn them back on after like 5 minutes AND preform the script that I sent an image of the click detector will be parented to a part named "DoorButton"

viral sapphire
#

this is not script making 👍

dire meadow
dry hornet
#

Pasting your exact message in to chatgpt would probably work

dire meadow
#

i cant send images in there

dry hornet
#

copy and paste your code, dont take a picture of it

dire meadow
#

alr lemme try

#

this is what it generated does it look good?

local buttonDoor = workspace.ButtonDoor -- Assuming ButtonDoor is in the workspace, modify this accordingly

function onClicked(playerWhoClicked)
wait(0.5)
script.Parent.Parent.Parent.Buzzer.Value = true
wait(0.1)
script.Parent.Parent.Parent.ZoneID.Value = playerWhoClicked.Name .. ": " .. script.Parent.Parent.CallPointID.Value
script.Parent.Parent.Parent.State.Value = "alarm"

-- Disable collisions for ButtonDoor
buttonDoor.CanCollide = false
wait(3)
-- Enable collisions for ButtonDoor after 3 seconds
buttonDoor.CanCollide = true

end

script.Parent.ClickDetector.MouseClick:Connect(onClicked)

dry hornet
#

Yea looks like it can work

dire meadow
#

Will it matter what the button is named?

dry hornet
#

The name of your ButtonDoor part must match whatever is written in the script workspace.ButtonDoor

dire meadow
#

No like the part that holds the click detector

dry hornet
#

Ah, no doesn't look like it. Nothing in the script you've shown is looking at the script.parent.Name

dire meadow
#

It worked but it didnt work for the part collision thing

dry hornet
#

Do you have a part named ButtonDoor as a child of workspace in the editor?

#

It can't be in a folder or another part or anything, if it is you need to change local buttonDoor = .. to the exact path to the part

#

Oh, and read the comment that chatgpt gave you -- Enable collisions for ButtonDoor after 3 seconds . You only have 3 seconds to test the collision. May want to make it longer.

dire meadow
#

ohhh

#

ok lemme try

#

yeah i tried that it works now

#

thank you bro