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

PlayerGui children not working? [UNANSWERED]

Asked by 8 years ago
script.Parent.Touched:connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        local playergui = player:WaitForChild("PlayerGui")
        if playergui then
            local shophud = playergui:WaitForChild("ShopHUD")
            if shophud then
                local shopframe = shophud:WaitForChild("ShopFrame")
                if shopframe then
                    shopframe.Visible = true
                end
            end
        end
    end
end)

This seems to stop at line 6 when I add prints to see where it will stop. Their is no error in the output, and it works on Play Solo, but not on servers or online. Please help.

0
Are you sure ShopHUD is a child of PlayerGui? Also, Scripts can't access PlayerGui when FE is enabled. User#11440 120 — 8y
0
Well the ShopHUD is in StarterGui, and when I go into the PlayerGui it is their, and how can I tell if filtering enabled is on?? NinjoOnline 1146 — 8y
0
It's under the property's of workspace. User#11440 120 — 8y
0
Oh yeah it was ticked, so it should work now?? NinjoOnline 1146 — 8y
View all comments (3 more)
0
Yeah User#11440 120 — 8y
0
For the record though, FE is very useful and I'd recommend keeping it checked. You would need to use Remote Events to change the PlayerGui using the normal script with FE. User#11440 120 — 8y
0
Yeah I got it working, but quick question, how can I change a players leaderstats? Like add certain points to them? Would I need to like use a remoteevent to get into a localscript to award them the points? NinjoOnline 1146 — 8y

1 answer

Log in to vote
-3
Answered by 8 years ago

I'm pretty sure you have clone your gui into the player I think .

0
The gui is automatically put into the playergui NinjoOnline 1146 — 8y
Ad

Answer this question