I currently have UserInputService.MouseIconEnabled in my script, but when I run the opening scene the mouse does not turn invisible and I’m not sure why.
This is the entire script of the opening scene currently
local DialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("DialogueEvent")
local ToggleDialogueEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("ToggleDialogueEvent")
local started = false
local UserInputService = game:GetService("UserInputService")
local TS = game:GetService("TweenService")
local function StartingText()
game.ReplicatedStorage:WaitForChild("StartingText"):FireAllClients()
wait(10)
ToggleDialogueEvent:FireAllClients(true) --toggles dialogue to visible
DialogueEvent:FireAllClients("Do you") --Dialogue Talking
wait(7.75)
DialogueEvent:FireAllClients("remember?")
wait(10)
DialogueEvent:FireAllClients("Everything")
wait(10)
DialogueEvent:FireAllClients("is GRAY.")
wait(12.25)
ToggleDialogueEvent:FireAllClients(false)
wait(5)
game.Workspace.BGMusic:Play()
end
game.Players.PlayerAdded:Connect(function(player)
if started == false then
started = true
local screenCover = player.PlayerGui:WaitForChild("DialogueGui").ScreenCover
screenCover.Visible = true
UserInputService.MouseIconEnabled = false
StartingText()
wait(1)
local info = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local tween = TS:Create(screenCover, info, {BackgroundTransparency = 1})
tween:Play()
UserInputService.MouseIconEnabled = true
end
end)
(Sorry if the script itself isn’t super optimized, I’m only a decent coder right now.)
You placed both lines of MouseIconEnabled in one event where the Player is added? The game would basically make the mouse transparent, then opaque again?
According to your function for PlayerAdded, it would only wait 1 second for the StartingText, regardless of whether or not it completes, and attempt to tween, before setting the mouse’s MouseIconEnabled to true.
What you should do would be to separate this part of the code:
To a different function, so something like this:
local function TextFinished()
local info = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
local tween = TS:Create(screenCover, info, {BackgroundTransparency = 1})
tween:Play()
UserInputService.MouseIconEnabled = true
end
When the StartingText() function finishes with showing the text, add at the bottom of the function the TextFinished() function.
Sorry, but I’m not quite sure what you mean by this. Are you saying the problem is something with the wait(1) before the tween? Because the tween activates at the right time, which is 1 second after the StartingText() function finishes and starts playing the background music, so I’m not sure why the mouse’s icon wouldn’t do the same.
It worked! Now I just need to figure out why the custom icon doesn’t work. Do you think you may know why it doesn’t? (The code for it is in a local script I have put in StarterGui.)
The image might still be under moderation. I attempted to view the image through the ID given, and it seems like you’re using the Asset ID of it already (which is correct!).