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

How Do I Fix My GUI Animation Pop-Up, And Why Won't It Work?

Right now I am working on a small simulator game, and one problem i am facing is that my GUI animation for when you click won't show up, and when i tested my script, there is no errors in the output, and I've tested multiple times just in case i missed something, but there is still no error pop-up. I feel like there is a problem with the visibility part of the script, but i am not 100% sure. Here's my script:

local tool = script.Parent
local frame = game.StarterGui.PlayerUI.Animation

tool.Activated:Connect(function()
	frame.Visible = true
	wait(.25)
	frame.Visible = false
end)

1 comment

0

Don't forget to accept my answer if it helps.

1 answer

✓ Accepted answer

Firstly make sure that it is in a LocalScript.

The issue is that you are using StarterGui. The StarterGui is merely what the PlayerGui clones out of when the player (re) spawns. The PlayerGui is located in the player. The GUIs the player sees and the local scripts running are the ones in PlayerGui.

local tool = script.Parent
local client = game:GetService("Players").LocalPlayer

tool.Activated:Connect(function()
    local frame = client.PlayerGui.PlayerUI.Animation
    frame.Visible = true
    wait(.25)
    frame.Visible = false
end)

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