My mouse cursor icon won't change, anyone know how to do it correctly?
This is my script that changes the mouse cursor icon:
The problem is, it doesn't change the mouse icon. Do anyone knows how to change the cursor icon correctly?
It's a localscript, so yeah.
Here's my full script:
007 | until script.Parent.Parent.Parent:IsA( "Player" ) or script.Parent.Parent.Parent:IsA( "Model" ) |
009 | local tool = script.Parent |
010 | local config = tool.Configuration |
011 | local clip = config.ClipSize |
012 | local unlimited = config.Unlimited |
013 | local reserve = config.Remain |
014 | local remote = tool:WaitForChild( "RemoteEvent" ) |
015 | local plr = game.Players.LocalPlayer |
016 | local mouse = plr:GetMouse() |
017 | local gungui = script.GunGui |
018 | local aimgui = script.AimGui |
022 | local ammo = clip.Value |
025 | local equipped = false |
032 | local currentspread = spread |
035 | local ignoreWater = true |
036 | local gridifyTerrainCells = false |
039 | local function decode(kind, code) |
040 | if kind = = "byte" then |
041 | local success, msg = pcall ( function () |
049 | return string.byte(code) |
055 | local cam = game.Workspace.CurrentCamera |
057 | game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson |
058 | local minusFOV = 70 - aimFOV |
059 | aimgui.Parent = plr.PlayerGui |
060 | for i,v in pairs (tool:GetChildren()) do |
061 | if v.Name ~ = "Fire" then |
062 | if v:IsA( "UnionOperation" ) then |
067 | for i = 1 ,minusFOV do |
068 | cam.FieldOfView = cam.FieldOfView - 1 |
071 | cam.FieldOfView = aimFOV |
074 | local function unaim() |
075 | local cam = game.Workspace.CurrentCamera |
076 | cam.FieldOfView = aimFOV |
077 | game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic |
078 | local plusFOV = 70 - aimFOV |
079 | aimgui.Parent = script |
080 | for i,v in pairs (tool:GetChildren()) do |
081 | if v.Name ~ = "Fire" then |
082 | if v:IsA( "UnionOperation" ) then |
088 | cam.FieldOfView = cam.FieldOfView + 1 |
094 | tool.Equipped:Connect( function () |
097 | aimgui.Parent = script |
098 | gungui.Parent = plr.PlayerGui |
099 | anim [ 1 ] = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Idle) |
100 | game.Workspace.CurrentCamera.FieldOfView = 70 |
106 | tool.Unequipped:Connect( function () |
109 | aimgui.Parent = script |
110 | gungui.Parent = script |
113 | game.Workspace.CurrentCamera.FieldOfView = 70 |
116 | mouse.Button 1 Down:Connect( function () |
120 | mouse.Button 1 Up:Connect( function () |
124 | mouse.Button 2 Down:Connect( function () |
125 | if equipped = = true then |
131 | mouse.Button 2 Up:Connect( function () |
132 | if equipped = = true then |
138 | mouse.KeyDown:Connect( function (key) |
139 | local code = decode( "byte" , key) |
141 | if equipped = = true then |
143 | if config.AmmoInClip.Value < config.ClipSize.Value then |
144 | if config.Remain.Value > 0 then |
145 | remote:FireServer( "reload" ) |
148 | if script.Parent.Parent:IsA( "Model" ) then |
150 | else equipped = false |
152 | elseif config.Unlimited.Value = = true then |
153 | remote:FireServer( "reload" ) |
156 | if script.Parent.Parent:IsA( "Model" ) then |
158 | else equipped = false |
167 | while wait(cooldown) do |
168 | if equipped = = true then |
169 | if holding = = true then |
170 | local realSpread = spread |
171 | if config.AmmoInClip.Value > 0 then |
172 | if (mouse.hit.p - tool.Fire.Position).magnitude > 100 and (mouse.hit.p - tool.Fire.Position).magnitude < = 250 then |
173 | realSpread = spread * 2 |
175 | if (mouse.hit.p - tool.Fire.Position).magnitude > 250 and (mouse.hit.p - tool.Fire.Position).magnitude < = 500 then |
176 | realSpread = spread * 4 |
178 | if (mouse.hit.p - tool.Fire.Position).magnitude > 500 and (mouse.hit.p - tool.Fire.Position).magnitude < = 1000 then |
179 | realSpread = spread * 6 |
181 | if (mouse.hit.p - tool.Fire.Position).magnitude > 1000 and (mouse.hit.p - tool.Fire.Position).magnitude < = 2500 then |
182 | realSpread = spread * 8 |
184 | if (mouse.hit.p - tool.Fire.Position).magnitude > 2500 then |
185 | realSpread = spread * 10 |
187 | if aiming = = true then |
188 | realSpread = spread / 2 |
190 | remote:FireServer( "fire" , mouse.Hit.p, realSpread) |
192 | else tool.Fire.Click:Play() |