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

How would i make a script where when the mouse is hoverd then the gui changes to diffrent colors?

Asked by
Cyrakohl 108
7 years ago

Ive been trying but i cant seem to crack it i dont really know

0
use the MouseEnter and MouseLeave functions ... FinickOdre123 6 — 7y
0
You mean when the mouse is in the GUI? Meltdown81 309 — 7y
0
Hmm let me get studio open and test some things.  JK I can't get on RBLX Studio rn rustyhuskey 59 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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
0
this script will lag the game with that while loop Filipalla 504 — 7y
Ad
Log in to vote
0
Answered by
Cyrakohl 108
7 years ago

I may have to edit it to tell it that the frame is what i want it to be in

Answer this question