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

Pop-Up Gui not working on roblox player but in roblox studio. Maybe PlayerGui failing?

Asked by 6 years ago
script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local playercharacter = hit.Parent.Name
        local player = game.Players:FindFirstChild(playercharacter)
        local gui = player.PlayerGui.FinallyFire
        gui.Enabled = true
    end
end)

Whats wrong with it?

1 answer

Log in to vote
0
Answered by 6 years ago

This has nothing to do with the playergui failing xD. Inside the server the playergui doesn't even exist. So you cannot access it...

This is the solution

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local playercharacter = hit.Parent.Name
        local player = game.Players:FindFirstChild(playercharacter)
        local gui = script.Parent:WaitForChild('FinallyFire'):Clone()
        gui.Parent = player:WaitForChild('PlayerGui')
    end
end)

So you'll have to put the gui next to the script.

If you have any questions, just ask (please set this as best answer) :)

0
Best answer. SuperBeeperman 30 — 6y
0
but i have a problem, the script and gui is in a group and that group is inside ANOTHER group, does that change anything? SuperBeeperman 30 — 6y
0
I don't really understand what you mean with group? a Folder? If it is, it doesn't matter as long as you update the gui variable too (line 5) User#20388 0 — 6y
Ad

Answer this question