Hello i want to know how i can return True or False from a function bind to a button.
local Main_Frame = script.Parent
local ButtonYes = Main_Frame.ButtonYes
local ButtonNo = Main_Frame.ButtonNo
local Response = nil
Response = ButtonYes.Activated:Connect(function()
print('true')
return true
end)
Response = ButtonNo.Activated:Connect(function()
print('false')
return false
end)
print(Response)
When i click on a button it correctly print << true or false >> but Response print only the connection link
do print(tostring(Response))
My goal is to have a Client_1 → Server → Client_2
Client_1 send a remote function to the Server who send an other remote function to Client_2 to show a GUI with 2 Buttons Yes or No and return whenever the Yes or No button as been clicked to Client_1 but i’m struggling to just get the true or false from the Button.Activated:Connect event
I guess i will need to redo my scripts it seem we can’t return value from function bind to a connect event
Oh
You could basically just do
:FireServer(true)
onclientevent connect
onserverevent connect
.