Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class "Button" "BaseInput" {
- new=function(self,part)
- assert(part~=nil,"Button requires part in constructor")
- local connection
- connection=part.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- self:setState(1)
- connection:disconnect()
- end
- end)
- end
- }
- class "Lamp" "BaseOutput" {
- new=function(self,part)
- assert(part~=nil,"Lamp requires part in constructor")
- self.lampLight=Instance.new("PointLight",part)
- self.lampLight.Enabled=false
- end,
- output=function(self)
- self.lampLight.Enabled=true
- end,
- stopOutput=function(self)
- self.lampLight.Enabled=false
- end
- }
- Button(workspace.Button):connect(Lamp(workspace.Lamp.LampPart))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement