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

Making the style change help?

I am making a script where it changes the style when it is clicked. Yes this script works and it is in a for loop but this part of the script does not work. Everything else does, just not this.

if v.Style == "RobloxRoundDefaultButton" then -- there are no errors for this part
	v.Style = "RobloxRoundButton"
else
	v.Style = "RobloxRoundDefaultButton"
end

1 answer

Ah, I see

v.Style is a ENUM, not a string!

so...

if v.Style == 4 then -- there are no errors for this part
    v.Style = 3
else
    v.Style = 4
end

see the wikidocumentation

http://wiki.roblox.com/index.php?title=API:Enum/ButtonStyle (I might not be doing this right, and if I'm not, just remove the "" 's)

2 comments

0

You can use numbers, or you can use Enum.ButtonStyle.RobloxButton, but usually strings are accepted as well...

0

This did not help but thanks anyway. I will use debounce for this. I was just trying to be more efficient.

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