drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 05 Nov 2016 04:35 AM |
This is a script that attaches my gui to a player head. I want that gui to be visible to all players, but it is only visible to the local player. How would I fix this so all players can see it?
while true do wait(0) script.Parent.Adornee = script.Parent.Parent.Parent.Character.Head script.Parent:clone() end |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 08:28 AM |
You have a serve rscript in SSS wait for a players character added, then you attach the BillBoardGui to their head with a -y Offset, and there you go.
As long as it's in the StarterGui, it'll always be local to the client. |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 05 Nov 2016 10:48 PM |
So change it to something like this and put it in ServerScriptStorage?
game.Players.ChildAdded:connect(function (child) wait(0) script.Parent.Adornee = script.Parent.Parent.Parent.Character.Head script.Parent:clone() end)
-- This is what I tried and it did not work. |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
| |
|
|
| 06 Nov 2016 12:02 AM |
| what is the gui parented to? |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
| |
|
|
| 06 Nov 2016 12:11 AM |
| so it's parented and adorned to the head? |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 12:16 AM |
| Ok, I'm not sure what your asking, but the script is parented to the gui itself, and the gui is adorneed to the character head. I hope this helps make sense of what im trying to say haha. |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:17 AM |
| you still didn't say where the gui is parented to tho :/ |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 12:23 AM |
| The gui is under StarterGui in the first sample of the script, and in the second sample I placed it under ServerScriptStorage. Other then that, the script Adorns it to the head of the player (or is supposed to) |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:27 AM |
| I believe for everyone to see it you have to parent it to workspace or somewhere in the workspace. Im not sure why you used adornee in the first place tbh |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:28 AM |
Well, if you are not using FilteringEnabled it'd simply be something like:
game.Players.PlayerAdded:connect(function(player) local gui = game.ReplicatedStorage.BillboardGui --or wherever you keep this gui, if you aren't making a new one through Instance.new() gui.Parent = player.Character:FindFirstChild("Head") gui.Adornee = player.Character:FindFirstChild("Head") end) or if you want them to keep it even when they respawn just put it in a local script and do player = game.Players.LocalPlayer player.Character.Humanoid.Died:connect(function() --wait until player respawns gui.Parent = player.Character:FindFirstChild("Head") gui.Adornee = player.Character:FindFirstChild("Head") end)
If you are using FE, then what you'd want to do is use a remote event, put event:FireServer() in the local script and then the code in the server script with event.OnServerEvent:connect(function(player) at the top and end) to finish |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 12:29 AM |
Parent it to workspace? How would I do that if it is a gui, and I want everyone to be able to see it?
I am using adornee because the other script within the gui displays each persons individual level. |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 12:32 AM |
If you want to see how it works locally (I.E. only you can see your own level instead of everyone being able to see it) here is the link to my game that I am working on:
https://www.roblox.com/games/421440694/Collision-Island-Under-Development |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 12:38 AM |
| I'm not using filtering enabled. Thanks. I will try it and let you know what happens. |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:41 AM |
@Skender can i just ask what the point of using adornee is when it is parented to the same place? |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:46 AM |
| @enzo I was thinking of SelectionBox. Nonetheless, it still works. I usually don't use billboardguis though, I'm more of a surfacegui or just screengui kind of gui myself. Much cleaner. |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 12:49 AM |
So.... I tried this and switched it to a local script and moved it to Replicated Storage, but now instead of it showing up locally, nothing shows up. Im confuzled.
player = game.Players.LocalPlayer local gui = game.ReplicatedStorage.BillboardGui player.Character.Humanoid.Died:connect(function() gui.Parent = player.Character:FindFirstChild("Head") gui.Adornee = player.Character:FindFirstChild("Head") end) |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:52 AM |
| is that script in StarterGui? |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 12:53 AM |
| No, the script is within the gui itself. The gui is in replicated storage. |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:54 AM |
| well move the script to StarterGui or StarterPack and see if that works |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:54 AM |
Wait...you put your billboard gui in replicated storage, not the script, right? Put the local gui in the player's playergui or starterpack, put the billboardgui in replicated storage and name it "BillboardGui" if it isn't already. Also I forgot to clone it, then move it. Try this:
player = game.Players.LocalPlayer player.Character.Humanoid.Died:connect(function() local gui = game.ReplicatedStorage.BillBoardGui:Clone() gui.Parent = player.Character:FindFirstChild("Head") gui.Adornee = player.Character:FindFirstChild("Head") --you might not need this, idrk how billboardguis work exactly end) |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:55 AM |
| put the local script in the player's playergui or starterpack*** |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 12:55 AM |
| also you are gonna have to use a clone of the gui so that you don't lose it when you die. |
|
|
| Report Abuse |
|
|
drc3
|
  |
| Joined: 14 Aug 2009 |
| Total Posts: 1284 |
|
|
| 06 Nov 2016 01:00 AM |
| Haha, come to my game real quick. I am in it and I can possibly explain what is going on? |
|
|
| Report Abuse |
|
|