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

how to place a "ScreenGui" from a tool into playerGui?

i wanted to make a tool that will show "screengui" (i already put a frame) that i place inside my tool. so i planned to make the "screengui" appeared when i equip it and disappeared when i unequp it. here the script that i wrote

function set1()
	if dimension == false then
		local c = script.Parent.ScreenGui:Clone()
		c.Parent = game.Players.PlayerGui
	end
end
script.Parent.Equipped:connect(set1)

is something wrong?

1 answer

✓ Accepted answer

Hey! Make sure this script is in a local script. You were missing one word which was the LocalPlayer

function set1()
    if dimension == false then
        local c = script.Parent.ScreenGui:Clone()
        c.Parent = game.Players.LocalPlayer.PlayerGui
    end
end
script.Parent.Equipped:connect(set1)

Hope this helps if it doesn't than comment and I'll take another look :)

1 comment

0

thx for the help!

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