I have been scripting for 2 weeks now, my question is how can i possibly call 2 functions under 1 event, for example if I am trying to create a animated button door how am i gonna make the functions not run at the same time ?
Thanks
You just need to use if and elseif statements:
local Opened = false script.Parent.MouseClick:Connect(function() --Script is located in a "ClickDetector" if Opened == false then --Checks to see if it's false Opened = true --sets to true print("Door is open") elseif Opened == true then --If the value is not false it immediately runs this part Opened = false print("Door is closed") end end)
More info about if statements/Conditional statements: https://developer.roblox.com/en-us/articles/Conditional-Statements-in-Lua
function a() print("bruh") end function b() print("moment") end event:Connect(function() a() b() end) >>>bruh >>>moment
do you mean something like this?