Hey im new to the scripting helpers plus new to roblox studio scripting so i need a little help from you. Well , i need a LocalGui to appear when you click a part , (i have the clickdetector done and i have tested it with print) but its not working for me ( on the second line there is my name because idont know how to get there localplayer
function OnClick() playerfind = game.Players:FindFirstChild(script.Parent.Parent.Anto3oo.Name.Value) guiclone = script.Buyframe:clone() guiclone.Parent.Parent.Parent = playerfind.PlayerGui end script.Parent.ClickDetector.MouseClick:connect(OnClick)
The location of the script is
game.Workspace.Blender.script
And the gui is
game.Workspace.Blender.script.BuyFrame
The MouseClick event from the ClickDetector provides you with the player that clicked. Knowing this you could directly access their PlayerGui to add a new Gui.
function OnClick(playerThatClicked) local guiclone = script.Buyframe:Clone() --Use :Clone() guiclone.Parent = playerThatClicked.PlayerGui end script.Parent.ClickDetector.MouseClick:Connect(OnClick) --connect is deprecated. Use Connect.
This adds a Gui to the Player using the server. You could also do this using a local script to have more functionality when editing the gui.
If I missed anything or you need anything explained let me know.