You can’t merge localscripts with scripts. Give me an example of you using Color3.new()/255 just to make sure. like for example Color3.new(150/255,80/255,60/255)
Ok. Here it is:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Text = “Off”
wait(0.1)
script.Parent.Frame.BackgroundColor3 = Color3.new(255,0,0)
end)
Anything to change?
instead of Color3.new(255,0,0) try Color3.new(255/255,0/255,0/255)
Nothing should I use a normal script?
Also you’re trying to change the color of the text button right? so remove the frame part and make it script.Parent.BackgroundColor3 since there’s no frame parented to the textbutton. You can’t use a normal script with guis as guis are only local.
Thanks! That’s the solution. Sorry for the long discussion.
Before you go is there a way so I can make it so I can make it green again when it’s clicked again?
Yes, you can, use a debounce like this:
local Debounce = false
script.Parent.MouseButton1Click:Connect(function)
if Debounce == false then
Debounce = true
--do stuff
elseif Debounce == true then
Debounce = false
--do other stuff
end
end)
I made this in chrome and not in studio so it I might have misspelled some things
Just because I am new to this and I am not a scripter. Inbetween debounce = true and elseif debounce == true then is that were I put it? Or…
Or different script? (30 chars)
local changing = false
script.Parent.MouseButton1Click:Connect(function()
if changing == false and script.Parent.BackgroundColor3 ~= Color3.new(255/255,0,0) then
changing = true
script.Parent.Text = “Off”
wait(0.1)
script.Parent.BackgroundColor3 = Color3.new(255/255,0,0)
changing = false
elseif changing == false and script.Parent.BackgroundColor3 ~= Color3.new(0,255/255,0) then
changing = true
script.Parent.Text = “On”
wait(0.1)
script.Parent.BackgroundColor3 = Color3.new(0,255/255,0)
changing = false
end
end)
(remove frame)
Hm I try some of these ideas but it comes up with this error:
Yes. Instead of using Roundify, use UICorner. Click on the item that you want to make round, then click the (+) button next to the name. Scroll down until you see the Instance: “UICorner”.
Alright I’ll note that (30 chars)
Click show details and tell me whats there, also recopy my script as I made necessary edits, this should be resolved in a short time as there are many replies.
Are you sure I can just copy it?
It only happens sometimes. I don’t know why?
When you use this, any UI element keeps it’s properties and are able to changed via scripts and localscripts.
Right. Thanks I will download it now.
Ok it worked. Thanks alot. (30 chars)