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

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

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

✓ Accepted answer

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) :)

3 comments

0

Best answer.

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?

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)

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