#(Solved) How can I allow the mouse to move?

1 messages · Page 1 of 1 (latest)

fallow pine
#

I have a script that pops up a GUI when the player dies. I want to add more buttons (spectate, revive, etc), but the problem that I'm having is that when the player dies, they can't move their mouse. As a temporary solution, I put the Try Again button right where the mouse is, but that'll be an issue when I want to add more buttons.

#
local StarterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local scrap = game.StarterGui.Scrap:GetDescendants()
local health = game.StarterGui.HealthGui

local teleport = ReplicatedStorage.Events.Teleport

local gui = script.Parent
local button = gui:WaitForChild("TextButton")
local message = gui:WaitForChild("TextLabel")
local image = gui:WaitForChild("ImageLabel")

--[[repeat
    local success = pcall(function()
        StarterGui:GetCore("ResetButtonCallback", false)
    end)
    task.wait(0.5)
    
until success]]

button.Activated:Connect(function()
    teleport:FireServer()
    button.Visible = false
    message.Text = "Loading..."
end)

humanoid.Died:Connect(function()
    while player:GetAttribute("Dead") == true do
        scrap.Visible = false
        health.Visible = false
    end
    
    --UserInputService.MouseBehavior = Enum.CameraMode.Classic
    --UserInputService.MouseBehavior = Enum.MouseBehavior.Default
    
    script.Rip:Play()
    image.Visible = true
    button.Visible = true
    message.Visible = true
    message.Text = "You Died."
end)```
#

this is my script. whenever i remove the comment marking on

   --UserInputService.MouseBehavior = Enum.MouseBehavior.Default```
the GUI doesn't pop up at all for some reason
slow ferry
fallow pine
#

i see something that says "ResetOnSpawn" which is false

spiral oasisBOT
#

studio** You are now Level 1! **studio

fallow pine
#

should i enable it?

fallow pine
#

bump

fallow pine
#

Solved! Someone on reddit told me that enabling the "Modal" attribute would do what I wanted.