Well I kept trying to let a GUI clone to PlayerGui to show itself up when an event happens,
but however when I run it in the studio it was not working, I checked for errors but there’s nothing wrong with the script. I also tried to look for solutions on hub in other people’s post, but there’s nothing about this situation.
Here’s My Script:
local ObjGui = game.ReplicatedFirst.Objective.Objectives:Clone()
ObjGui.Parent = game.Players.LocalPlayer.PlayerGui
As when I run the game at studio, it will show like this:
You can’t use LocalPlayer on Server-Side. You’ll have to use Remotes to achieve this.
Besides, server can’t really access PlayerGui because there were flaws (account stealers) so you’ll have to use a remote and fire client to open that UI.
Try this this will work cause it worked for me with a part to put it in the PlayerGui
But the only thing is that it will only add the part when a player joins i can’t find any other way
game.Players.PlayerAdded:Connect(function(plr)
local Part = game.ReplicatedFirst.Objective.Objectives
Part.Parent = plr.PlayerGui
end)
oh yeah it’s working properly, but this is more like when a player connected in a server and this will appear i quite want to know if it could be like after a event and then happens
So what i did is get the player location by setting plr after the function it does the same but in an other way and that’s how my script work but i can’t find any other way possible but i hope i did help you a little bit.