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

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

Asked by
Annon28 23
7 years ago

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

Log in to vote
0
Answered by 7 years ago

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

0
thx for the help! Annon28 23 — 7y
Ad

Answer this question