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

is there a way to combine these2 scripts?

function onEnter()
	script.Parent.BackgroundTransparency = 0.7
end
script.Parent.MouseEnter:connect(onEnter)
function onLeave()
	script.Parent.BackgroundTransparency = 1
end
script.Parent.MouseLeave:connect(onLeave)

i was wondering if one could combine these scripts to make them cleaner and faster

1 answer

Well, you could use a different connection line. It takes up less space and looks a bit neater.

script.Parent.MouseEnter:connect(function()
	script.Parent.BackgroundTransparency = 0.7
end)

script.Parent.MouseLeave:connect(function()
	script.Parent.BackgroundTransparency = 1
end)

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