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

How do you change the appearance of a cursor in-game?

Asked by 9 years ago

I want to make the cursor in my game have a different appearance along with also having different one when rolled over a clickable object.

1 answer

Log in to vote
0
Answered by 9 years ago

If you want to change the Cursor when putting over a Click detector.

For that you would place a LocalScript in a place like StarterGui

01local player = game.Players.LocalPlayer
02local character = player.Character
03    local character = player.Character
04if not character or not character.Parent then
05    character = player.CharacterAdded:wait()
06end
07local mouse = player:GetMouse()
08local Hover = false
09 
10mouse.Move:connect(function()
11    local target = mouse.Target --The block the mouse is touching
12    if target == nil then
13        --Leave empty
14    elseif target.Name == "ClickableObject" then --Change this to name of your button
15        mouse.Icon = "asdhajsoidjia" --Changes mouse Icon when hovering
16                Hover = true
17    else
18        mouse.Icon = "asdjiasf;k,fgm" --Changes mouse Icon back to normal while not hovering
19    end
20end)

You would then add a click function while hovering is on, also change the Icon to the ones you want.

Ad

Answer this question