So, I have created two single Scripts both optimizing different sections of function. The Scripts work perfectly fine like required however as soon as the player would to die or reset the Players cursor will disappear how would I fix?
Loading Gui Script:
-- LoadingGui Script
local UserInputService = game:GetService("UserInputService")
UserInputService.MouseIconEnabled = false
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)
task.wait(10)
for i = 0,1,0.1 do
script.Parent.Transparency = i
wait(0.02)
end
script.Parent.Visible = false
script.Parent.LoadingText.Visible = false
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
UserInputService.MouseIconEnabled = true```
StarterCharacter > Local Script for Cursor Cient Script:
-- Press "V" to unlock/lock the players Mouse
-- VToUnlock/LockMouse Script
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
game.Workspace:WaitForChild(player.Name)
player.PlayerGui:WaitForChild("FreeMouse")
player.PlayerGui.FreeMouse:WaitForChild("ModalOption")
mouse.KeyDown:connect(function(key)
if key == "v" then
if player.PlayerGui.FreeMouse.ModalOption.Modal == false then
player.PlayerGui.FreeMouse.ModalOption.Modal = true
else
player.PlayerGui.FreeMouse.ModalOption.Modal = false
end
end
end)
-- Enable the Cursor Script
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "rbxassetid://15096364738" -- Custom Cursor ID
simply move it into starterplayerscripts
because startercharacterscripts are stored inside the character, so if you reset they can bug out for things like this. starterplayerscripts dont get deleted when you die because they’re stored in the player
local player = game.Players.LocalPlayer
player.CharacterAdded:Connect(function() -- if character spawns or respawns it'll trigger
--disable mouse and enabled custom mouse or something idk
end)