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

My mouseEnter and mouseLeave isn't working?

Asked by
Aepeus 59
7 years ago

I'm trying to get messages to pop that follow your mouse when you hover over a part. However the script only works in studio but in actual game. I have tried both local script and script.

function mouseEnter(player)
    print("enter")
    local mouse = player:GetMouse()
    player.PlayerGui.Messages.Messages["Remote1"].Position = UDim2.new(0, mouse.X, -.1, mouse.Y)

end

function mouseLeave(player)
    print("left")
    player.PlayerGui.Messages.Messages["Remote1"].Position = UDim2.new(1, 0, 1, 0)
end

script.Parent.ClickDetector.MouseHoverEnter:connect(mouseEnter)
script.Parent.ClickDetector.MouseHoverLeave:connect(mouseLeave)

1 answer

Log in to vote
0
Answered by
farrizbb 465 Moderation Voter
7 years ago

When something in Roblox studios works but not in the game is it because the Client and the Server are the same thing in Roblox studio ,but not in game.Learn about remote events and functions to fix it

Ad

Answer this question