Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making the style change help?

Asked by 10 years ago

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

Log in to vote
0
Answered by
algo160 10
10 years ago

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)

0
You can use numbers, or you can use Enum.ButtonStyle.RobloxButton, but usually strings are accepted as well... Perci1 4988 — 10y
0
This did not help but thanks anyway. I will use debounce for this. I was just trying to be more efficient. raystriker6707 30 — 10y
Ad

Answer this question