Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to make double script in one board/layer ?

i like to know about double script in one script (2 script in one board(2x1)) example: i want to make a button door also a light above it goes on when the door open can somebody help me with this one.

1 comment

0

when ur done with making the button door drop a line after the last end and start on the light

1 answer

✓ Accepted answer

You have three parts in Workspace: The Door; The Button, and the Light Part.

In the button, you are going to insert a server script:

--Variables
local Button = script.Parent
local Light = game.Workspace.Light
local ClickDetector = script.Parent:WaitForChild('ClickDetector')
local Door = game.Workspace.Door
--Code

ClickDetector.MouseClick:Connect(function(plr) --when player clicked button
		--To open door
		Door.Transparency = 0.5
		Door.CanCollide = false
		Light.PointLight.Enabled = true
		
		--If you want to close the door
		wait(2)
		Door.Transparency = 0
		Door.CanCollide = true
		Light.PointLight.Enabled = false
		
		
end)

That is it.

This discussion is preserved as it was. New answers, comments, and votes are closed.