Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

The death gui i have will not show up on screen when i tween the position?

Asked by
MemezyDev 172
4 years ago

I don't know if either I did the tweening wrong or something else like that, but the Gui showed before I added the tween and now with the tween it doesn't work. Here's my script:

local gui = script.Parent.Parent
local player = game.Players.LocalPlayer

player.Character:WaitForChild("Humanoid").Died:Connect(function()
        wait(2)
        gui.Enabled = true
        gui:TweenPosition(UDim2.new(0, 0,0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Bounce)
        wait(3)
        gui.Enabled = false
end)
0
You cannot make a tween position for a screengui but can for other things such as a frame Gingerely 245 — 4y

1 answer

Log in to vote
1
Answered by
Gingerely 245 Moderation Voter
4 years ago
Edited 4 years ago

SO, I do not think you can tween pos a screen gui, therefore ; Instead of doing script.Parent.Parent, make a frame and put everything in it. Make the fram visible = false and make sure the frame is the parent of the local script.

local plr = game.Players.LocalPlayer
    local hum = plr.Character:WaitForChild("Humanoid") --// Waits until the player character loads and finds Humanoid
     hum.Died:Connect(function() 
        local gui = script.Parent
        if gui.Visible == false then --// Checks if gui is already visible
            gui.Visible = true
        wait() --// The wait after you die
        gui:TweenPosition(UDim2.new(0, 0,0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Bounce)
        wait(3) --// Wait for the gui to be gone.
        gui.Visible = false
    end
    end)
Ad

Answer this question