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

Is there any way to change the mouse icon size?

Asked by 5 years ago

Hey im trying to make a gun, so i made this script:

-- Algumas variaveis --
local pistola = script.Parent
local hole = pistola:WaitForChild("Hole")
local mouse = game.Players.LocalPlayer:GetMouse()

-- Lista de Valores --
local ammo = 12
local maxAmmo = 64
local damage = 20
local headshotDamage = 50
local range = 100
local coolDown = 0.5

-- impedir spamming --
local spam = false

-- Mudar o rato --
pistola.Equipped:Connect(function()
    mouse.Icon = "rbxassetid://358948940"
end)

pistola.Unequipped:Connect(function()
    mouse.Icon = ""
end)

-- Disparo --
pistola.Activated:Connect(function()
    if spam == false then
         spam = true
        pistola.Handle.Disparo:Play()
       local bullet = Instance.new("Part")
       bullet.Size = Vector3.new(range,0.25,0.25)
       local ray = Ray.new(hole.CFrame.Position, (mouse.Hit.Position - hole.CFrame.Position).Unit*range)
       local hit, position = workspace:FindPartOnRay(ray, game.Players.LocalPlayer.Character)
       local distance = (pistola.Handle.CFrame.p - position).magnitude
       bullet.CFrame = CFrame.new(pistola.Handle.CFrame.p, position) * CFrame.new(0,0, distance/2)
       bullet.Transparency = 0.5
       bullet.CanCollide = false
       bullet.Anchored = true
       bullet.Parent = game.Workspace
       bullet.Orientation = hole.Orientation
       bullet.Position = hole.Position
    game:GetService("Debris"):AddItem(bullet, 0.5) 
        spam = false
    end 
end)

Its not done yet, so you may see some errors. If you do pls tell me! Anyways, im setting the mouse.Icon to a crosshair that i found, but its just too big, so i wanted to know if there's any way that you can change its size.

1 answer

Log in to vote
1
Answered by 5 years ago

The mouse.Icon Size is dependent on the size of the image itself, so if your Cross hair image is 50x50 pixels then the mouse.Icon will be 50x50. Essentially what I'm saying is, you need to resize the image then reupload it.

0
Ok thx mewant_taco 17 — 5y
Ad

Answer this question