Ive been trying but i cant seem to crack it i dont really know
COMMUNITY QUESTION
How would i make a script where when the mouse is hoverd then the gui changes to diffrent colors?
2 answers
Okay, this would be the most found way I see right now in my mind I'm not at a computer right now to check the code, but I think this will work! PS I made it where It changes it back to white if there is no mouse
--\\ A value that makes sure the mouse is in the frame
local MouseIn = false
--\\ Mouse Button Entry
script.Parent.MouseEnter:connect(function()
MouseIn=true
end)
--\\ Mouse Button Leave
script.Parent.MouseLeave:connect(function()
MouseIn=false
end)
--\\ Frame Changer
while true do wait(.1)
if MouseIn then script.Parent.BackgroundColor3=Color3.new(math.random(0,1),math.random(0,1),
math.random(0,1))
else
script.Parent.BackgroundColor3=Color3.new(255,255,255) end
end
1 comment
0
this script will lag the game with that while loop
I may have to edit it to tell it that the frame is what i want it to be in
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
use the MouseEnter and MouseLeave functions ...
You mean when the mouse is in the GUI?
Hmm let me get studio open and test some things. JK I can't get on RBLX Studio rn