script.Parent.Touched:Connect(function(hit) local character = hit.Parent if character then local player = game.Players:GetPlayerFromCharacter(character) if player then local playerGui = player:FindFirstChild('PlayerGui') if playerGui then local hud = playerGui:WaitForChild('HUD') if hud then print(4) local shop = hud:FindFirstChild('ShopXY') if shop then print(5) if not debounce then debounce = true shop.Visible = true shop:TweenPosition(UDim2.new(0, 0, 0.5, 0), 'Out', 'Back', 1, true) local humanoid = character:FindFirstChild('Humanoid') if humanoid then humanoid.WalkSpeed = 0 humanoid.JumpPower = 0 end wait(1) debounce = false end end end end end end end)
Currently, I am trying to create a part that when touched opens up a shop UI. It stops at the local hud variable. Originally I had it as FindFirstChild(), but since that wasn’t working I changed it to WaitForChild(). Still not working. There is a ScreenGui called HUD (spelt exactly how it is written in the code) and it is inside the PlayerGui, so I don’t know why it ain’t picking it up.
I would think that if it can pick up the PlayerGui, that it can then see what’s inside it as well (seen as it can see what’s inside the backpack, etc.)