|
| 11 Aug 2013 03:44 PM |
There are no errors, but it doesn't do anything when I test it:
game.Players.PlayerAdded:connect(function(player) local char = player.Character char.Head.Transparency = 1 local fake = char.Head:Clone() fake.name = "FakeHead" local weld = Instance.new("Weld") weld.Parent = char.Head weld.Part0 = char.Head weld.Part1 = char.FakeHead player:WaitForDataReady() if player.DataComplexity == 0 then script.Parent.loginscreen.Visible = false script.Parent.signupscreen.Visible = true elseif player.DataComplexity > 0 then script.Parent.loginscreen.Visible = true script.Parent.signupscreen.Visible = false end end)
|
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 03:46 PM |
Umm....they player im any studio test DOES NOT allow data persistence, so you will be waiting for the DataReady thing....
(Recommended...have a loading screen, or a signup..) |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 03:48 PM |
| But the code for the fake head should run first. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2013 04:03 PM |
local char = player.Character char.Head.Transparency = 1 local fake = char.Head:Clone() fake.name = "FakeHead"
When you clone the head, you clone it with the transparency added already >.<
local char = player.Character local fake = char.Head:Clone() char.Head.Transparency = 1 fake.name = "FakeHead"
That will clone it and make the origional clear :P |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 04:59 PM |
| Ok, but with the original, it didn't even make the head transparent. It's like the script didn't even run at all! |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 05:00 PM |
| Put in some print() commands to see what is executing, what's holding it up, etc. |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 07:01 PM |
game.Players.PlayerAdded:connect(function(player)
That's the line that's screwed up! It would print anything after that line. But there are still no errors! |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 07:01 PM |
| It printed the print statement I made before that line. |
|
|
| Report Abuse |
|
|
| |
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 11 Aug 2013 07:19 PM |
| The 'PlayerAdded' event doesn't work in solo mode, this is because the player is loaded before the scripts that connect the 'PlayerAdded' event are. This is stated on the Wiki in a big red box. |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 11 Aug 2013 07:25 PM |
| Theres no weld keeping head in place |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 11 Aug 2013 07:26 PM |
oops, nevermind You may have to do a CharacterAdded or repeat wait() until player.Character |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 01:13 PM |
Revised:
game.Players.PlayerAdded:connect(function(player) local char = player.Character char.Head.Transparency = 1 local fake = char.Head:Clone() fake.Transparency = 0 fake.name = "FakeHead" fake.Parent = char local weld = Instance.new("Weld") weld.Parent = char.Head weld.Part0 = char.Head weld.Part1 = char.FakeHead player:WaitForDataReady() if player.DataComplexity == 0 then script.Parent.loginscreen.Visible = false script.Parent.signupscreen.Visible = true elseif player.DataComplexity > 0 then script.Parent.loginscreen.Visible = true script.Parent.signupscreen.Visible = false end end)
I tested it in onlne mode (tools>test>startserver>tools>test>startplayer), but it still didn't do aything, even with the changes shown above! |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 12 Aug 2013 01:50 PM |
There's a magical being known as 'Output'. Now, if you had of read the output in the server window, you would have noticed...
"Time:Time:Time:Time - Something.Something:3: attempt to index local 'char' (a nil value)"
1) When the 'PlayerAdded' event is triggered, the player's character isn't there instantly. 2) You'll find that this will only do what you want when they first join. If they reset, etc, they'll be the same as a normal character. 3) It's 'Name' not 'name'. (Line 6) |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 02:01 PM |
Revisions:
game.Players.PlayerAdded:connect(function(player) repeat wait() until player.Character local char = player.Character char.Head.Transparency = 1 local fake = char.Head:Clone() fake.Transparency = 0 fake.Name = "FakeHead" fake.Parent = char local weld = Instance.new("Weld") weld.Parent = char.Head weld.Part0 = char.Head weld.Part1 = char.FakeHead player:WaitForDataReady() if player.DataComplexity == 0 then script.Parent.loginscreen.Visible = false script.Parent.signupscreen.Visible = true elseif player.DataComplexity > 0 then script.Parent.loginscreen.Visible = true script.Parent.signupscreen.Visible = false end end)
I put "repeat wait() until player.Character" in there, and fixed the name thing like you said, but it still does nothing in online mode.
There are no errors either. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Aug 2013 02:31 PM |
| Why do I always have to bump to get a reply!? |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 12 Aug 2013 02:32 PM |
| Why cant you be patient like the others? |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 12 Aug 2013 02:34 PM |
| What part? There are no visible errors, and the 'FakeHead' works fine. |
|
|
| Report Abuse |
|
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 12 Aug 2013 02:35 PM |
| Put the guis in lighting andill help |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 03:58 PM |
Ok, so you are saying that this script should work? Maybe I need to try it in an actual server.
Sorry I snapped, I just have to bump a lot :P |
|
|
| Report Abuse |
|
|
| |
|