#Toggle

18 messages · Page 1 of 1 (latest)

sharp junco
#
local button = script.Parent.ToggleButton
local toggle = false

button.MouseButton1Click:Connect(function()
  if not toggle then -- if it is currently killing
    door:SetAttribute("Kill", false) -- or whatever you use for tracking
    toggle = true
    button.Text = "Off"
  elseif toggle then -- if it is not currently killing
    door:SetAttribute("Kill", true)
    toggle = false
    button.Text = "On"
  end
end)
#

or instead of SetAttribute use SetTag

vagrant spade
#

You mean tag by attributes or collection service thing?

vagrant spade
#

So u use collection srvice

#

Can you show hiearchie

#

I can take a loot at tomorrow morning May i have homework

gloomy hornet
vagrant spade
gloomy hornet
#

ah

vagrant spade
#

Uh

#

Where is button

gloomy hornet
#

oh I was just thinking of putting the button beside the door like this

vagrant spade
#

Well lemme make an algorithm for you

#

Door has an attribute called 'canKill' (bool) and button has a tag called button and an attribute called 'instance'.

#

Instance attribute is selected to door part