|
Hello, I made a messaging script. It is a local script in PlayerStarterScripts. When send ## #### it's supposed to generate a TextLabel to the selected player, but the output states 'PlayerGui is not a valid member of Player'. Can someone tell me why this is? Is it because it isn't possible to change another player's PlayerGui from another player? If this is so what can I do? |
|
|
I don't know what you are saying, but you cant change the parent of 'PlayerGui' but you can change the parents of the guis inside it
|
|
|
this is the script :
local receiveframe = Instance.new("ScrollingFrame")
receiveframe.Parent = v.PlayerGui.playersgui -- heres the error
receiveframe.Position = UDim2.new(0.681, 0, 0.619, 0)
receiveframe.Size = UDim2.new (0, 436, 0, 234)
receiveframe.ScrollBarThickness = 0
receiveframe.BorderSizePixel = 0
receiveframe.BackgroundTransparency = 1
I'm trying to instance a frame into a players gui. |
|
|
The frame has to be parented into a screengui that is parented into PlayerGui.
|
|
|
ah okay, let me try that. |
|
|
I'm getting the same output. this is the script now:
local receiveframe = Instance.new("ScrollingFrame")
receiveframe.Parent = v.PlayerGui.receiveframe
receiveframe.Position = UDim2.new(0.681, 0, 0.619, 0)
receiveframe.Size = UDim2.new (0, 436, 0, 234)
receiveframe.ScrollBarThickness = 0
receiveframe is a ScreenGui that every player has. |
|
|
Something like this.
local player = game.Players.LocalPlayer
local screengui = Instance.new("ScreenGui")
screengui.Parent = player.PlayerGui
local receiveframe = Instance.new("ScrollingFrame")
receiveframe.Parent = screengui
receiveframe.Position = UDim2.new(0.681, 0, 0.619, 0)
receiveframe.Size = UDim2.new(0, 436, 0, 234)
receiveframe.ScrollBarThickness = 0
|
|
|
Okay, I have added this, but the problem still persists e.e
output: PlayerGui is not a valid member of Player
The button that is clicked is from another client, once is clicked receiveframe is supposed to instance. If that's going to help. |
|
|
|
LnxlJoin Date: 2013-02-09 Post Count: 31 |
You are welcome!
game.Players.PlayerAdded:connect(function(plr)
local receiveframe = Instance.new("ScrollingFrame", plr:WaitForChild('PlayerGui'))
receiveframe.Position = UDim2.new(0.681, 0, 0.619, 0)
receiveframe.Size = UDim2.new (0, 436, 0, 234)
receiveframe.ScrollBarThickness = 0
receiveframe.BorderSizePixel = 0
receiveframe.BackgroundTransparency = 1
end)
game:Destroy() |
|
|
@1000knives
Try using the following commands in your script:
local gui = script.Parent.(GUI name goes here):Clone()
gui.Parent = game.Players.LocalPlayer.PlayerGui
|
|
LnxlJoin Date: 2013-02-09 Post Count: 31 |
The Bottom is my siggy btw!
game:Destroy() |
|
LnxlJoin Date: 2013-02-09 Post Count: 31 |
Btw you need it in a screengui for it to show!
--Game:Destroy()-- |
|
LnxlJoin Date: 2013-02-09 Post Count: 31 |
Like game.Players.PlayerAdded:connect(function(plr) local gui = Instance.new("ScreenGui", plr:WaitForChild('PlayerGui')) local receiveframe = Instance.new('ScrollingFrame', gui) receiveframe.Position = ############## ##### #### ##### receiveframe.Size = UDim2.new (0, 436, 0, 234) receiveframe.ScrollBarThickness = 0 receiveframe.BorderSizePixel = 0 receiveframe.BackgroundTransparency = 0 end) --Game:Destroy()-- |
|
|
Thanks for all the replies, but the problem is that a player can not alter another players gui, atleast I think. |
|