this is the whole code. and it works in studio
function onClicked()
local Name = game.Workspace.Quest1.Name
local Quest = game.Players.LocalPlayer.PlayerGui.Main.Quests.Frame
Quest.CName.Text = Name
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
i tried game.Players.PlayerAdded:connect(function) it failed
please help?
image of it not working / what im wanting
http://tinypic.com/view.php?pic=24gq99v&s=9#.V3k6QWgrKUk
function onClicked(hit)
local Name1 = hit.Parent.Name
local Name2 = game.Workspace.Quest1.Name
local Quest = game.Players[Name1].PlayerGui.Main.Quests.Frame
Quest.CName.Text = Name2
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
with that code, it outputs
11:20:15.210 - Players is not a valid member of Players 11:20:15.211 - Script 'Workspace.Quest1.Script', Line 5

4 comments
Why do you need a player added event?
Let me guess, server script? Or is it a LocalScript under workspace?
it needs player Added for the gui
it's a regular script btw