TeamDman
|
  |
| Joined: 04 Dec 2009 |
| Total Posts: 897 |
|
|
| 08 Jan 2013 04:50 PM |
Would it be possible for a player to have GUI objects in nil? ( Still be able to have their events fire when clicked? )
§TeamDman§ Anti-Jared |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 08 Jan 2013 04:53 PM |
| If the GuiObject is in nil, then it's not clickable. |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 04:53 PM |
script.Parent = nil script:Remove()
Both of these will keep the scripts running, but just parent them to nil. Removing the GUI object will obviously remove it from the screen. I hope this is what you were asking for. |
|
|
| Report Abuse |
|
|
TeamDman
|
  |
| Joined: 04 Dec 2009 |
| Total Posts: 897 |
|
|
| 08 Jan 2013 04:54 PM |
Sorry, I meant having the player's parent as nil, not the GUIs.
§TeamDman§ Anti-Jared |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 04:56 PM |
| Use ::Remove() or set the Parent property of the Player to nil. The GUI will still be usable. |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 04:56 PM |
Yes, that should still work.
I think that's how stickmasterluke made his 'Draw It!' game. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 08 Jan 2013 04:56 PM |
| Mm no, I think if player is placed in nil, they loose connection to server(well not really, they can see chat and stuff). |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 04:57 PM |
I think he meant setting the character to nil.
Player.Character = nil |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 04:59 PM |
| Only ::Destroy() removes all GUIs and what-not from the player. Using deprecated ::Remove() is simply the best way to go if you want GUIs to stay operational after the player is removed. |
|
|
| Report Abuse |
|
|
TeamDman
|
  |
| Joined: 04 Dec 2009 |
| Total Posts: 897 |
|
|
| 08 Jan 2013 05:00 PM |
Players can still do things in nil via localscripts. Once a player is removed or parented to nil the guis are removed. I was wondering if it was possible to have GUIS on your screen whilst your player.Parent == nil and be able to interact with them.
§TeamDman§ Anti-Jared |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 05:01 PM |
Are you sure you're using ::Remove()/p.Parent = nil? Double check that you're not using ::Destroy()... I've seen others still Admin Abuse without being in the game through the use of GUI-powered pseudo-players. |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 05:09 PM |
| GUI's don't get removed for me when I parent my player to nil. |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 05:13 PM |
| Why do people think nil is a thing? |
|
|
| Report Abuse |
|
|
TeamDman
|
  |
| Joined: 04 Dec 2009 |
| Total Posts: 897 |
|
|
| 08 Jan 2013 06:32 PM |
Are you testing that in studio? In a server ( not a studio server either) parenting to nil or doing anything to change the parent of your player will remove the GUIs.
§TeamDman§ Anti-Jared |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Jan 2013 07:09 PM |
| @arceus Because it is a thing, it's a value that represents nothing, it is not actually nothing. |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 07:14 PM |
@TeamDman
It seems like it does kick your player from the server.
Hmm, I'll keep that in mind. |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2013 07:44 PM |
"@arceus Because it is a thing, it's a value that represents nothing, it is not actually nothing."
If we're going to argue about language, nil is an idea. |
|
|
| Report Abuse |
|
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 09 Jan 2013 12:18 PM |
I did it a while ago. I used a billboardgui that follows the camera with a invisible local part, and simulated all events. Unfortunately, billboardguis are quite buggy; they flicker more the further they are away from the origin (0, 0, 0) and clipsdescendants doesn't work properly on images, making the use of tilemaps impossible. |
|
|
| Report Abuse |
|
|
TeamDman
|
  |
| Joined: 04 Dec 2009 |
| Total Posts: 897 |
|
|
| 09 Jan 2013 06:41 PM |
Did you have to re-size anything to accommodate the billboard gui?
§TeamDman§ Anti-Jared |
|
|
| Report Abuse |
|
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 11 Jan 2013 09:54 AM |
Yeah. I used something like this:
local players = game:GetService("Players") local runService = game:GetService("RunService") local player = players.LocalPlayer local mouse = player:GetMouse() local cameraPart = Instance.new("Part") local cameraGui = Instance.new("BillboardGui")
function InitializeCameraGui() cameraPart.Anchored = true cameraPart.BottomSurface = "Smooth" cameraPart.CanCollide = false cameraPart.FormFactor = "Custom" cameraPart.Locked = true cameraPart.Size = Vector3.new(0.2, 0.2, 0.2) cameraPart.TopSurface = "Smooth" cameraPart.Transparency = 1 cameraGui.Adornee = cameraPart cameraGui.AlwaysOnTop = true cameraGui.Parent = cameraPart runService.Heartbeat:connect(function() UpdateCameraGui() end) end function UpdateCameraGui() local camera = workspace.CurrentCamera if camera then cameraPart.CFrame = camera.CoordinateFrame * CFrame.new(0, 0, -64) cameraGui.Size = UDim2.new(0, mouse.ViewSizeX, 0, mouse.ViewSizeY) if cameraPart.Parent ~= camera then cameraPart.Parent = camera end end end
InitializeCameraGui()
It might seem strange that I used RunService.Heartbeat, but the Changed event is broken for "Custom" type cameras and the Heartbeat event has a relatively convenient timing. |
|
|
| Report Abuse |
|
|