Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

1 comment

0

You cannot make a tween position for a screengui but can for other things such as a frame

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.