btw is there a glitch in roblox studio becuz i tried changing the cursor with script but its not loading here it is :
and also it dont return back to normal when using empty string
local plr = game.Players.LocalPlayer
local humanoid = plr.Character.Humanoid
local run = game:GetService("RunService")
local cam = workspace.CurrentCamera
local souns = Instance.new("Sound")
souns.Parent = script
souns.Name = "Shooted"
souns.SoundId = "rbxassetid://560908171"
local relodSound = Instance.new("Sound")
relodSound.Parent = script
relodSound.SoundId = "rbxassetid://3606136833"
relodSound.Name = "reloadsoun"
local aiming = false
local aimcf = CFrame.new()
local gun = game.ReplicatedStorage.Weapons.glockarm:Clone()
local s = require(game.ReplicatedStorage.WeaponsModules:WaitForChild("Glock18"))
gun:SetPrimaryPartCFrame(cam.CFrame)
run.RenderStepped:Connect(function()
gun:SetPrimaryPartCFrame(cam.CFrame
*s.weaponpos
*aimcf
)
if aiming then
aimcf = aimcf:Lerp(s.AimCFrame, 0.1)
else
aimcf = aimcf:Lerp(CFrame.new(), 0.1)
end
end)
gun.Parent = cam
local idle = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.WeaponsModules.Glock18.Anim.idle)
idle:Play()
local shoot = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.WeaponsModules.Glock18.Anim.shoot)
local Mouse = plr:GetMouse()
Mouse.Icon ="http://www.roblox.com/asset?id=57571496"
Mouse.Button1Down:Connect(function()
shoot:play()
souns:Play()
Mouse.Button2Down:connect(function()
aiming = true
end)
Mouse.Button2Up:connect(function()
aiming = false
end)
game:GetService("UserInputService").InputBegan:Connect(function(input, Game)
if Game == true then return end
if input.KeyCode == Enum.KeyCode.R then
local reload = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.WeaponsModules.Glock18.Anim.reload)
reload:Play()
relodSound:play()
end
end)
end)
plr.CameraMode = Enum.CameraMode.LockFirstPerson
local function onDied()
gun.Parent.Parent = nil;
souns:Remove()
relodSound:Remove()
plr.CameraMode = Enum.CameraMode.Classic
Mouse.Icon =""
end
local function onUpdate(dt)
gun:SetPrimaryPartCFrame(cam.CFrame)
Mouse.Icon ="http://www.roblox.com/asset?id=57571496"
end
humanoid.Died:Connect(onDied);
run.RenderStepped:connect(onUpdate)
gun:SetPrimaryPartCFrame(cam.CFrame*s.weaponpos)