|
| 08 Feb 2014 08:29 AM |
I have a serverscript that handles the playeradded event.
I also have a localscript that handles clientside things and setting the CameraMode to LockFirstPerson.
They work. But there are some occasions they do not work. Also when they dont, no errors come up, the playeradded just doesnt fire, and the cameramode doesnt get set but the localscript works otherwise, coz it does other things with no errors.
WEIRD. |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 08 Feb 2014 08:30 AM |
>But there are some occasions they do not work. Also when they dont, no errors come up
So at least it works sometimes. Maybe post the script? |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 08:34 AM |
| Im feeling uncomfortable posting over 2000 lines.. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 08:35 AM |
But here are the parts that i was talking about though, they just do not fire:
localplayer.CameraMode = Enum.CameraMode.LockFirstPerson
game.Players.PlayerAdded:connect(function(plr) print("Player "..plr.Name.."(userId: "..plr.userId..") joined the server") plr.TeamColor = BrickColor.new("White") updateGamefeed(plr.Name.." joined the server") local stats = game.ServerStorage.defplayer:clone() stats.Parent = script.Playerlist stats.Name = plr.Name plr.CharacterAdded:connect(function(c) --setAppearance(plr) local wp = rootDataStorage.Weapon:clone() wp.Parent = c repeat wait() until c:findFirstChild("Health") and c:findFirstChild("HealthScript v3.1") c["HealthScript v3.1"]:Destroy() c["Health"]:Destroy() end) end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 08 Feb 2014 09:58 AM |
| if playeradded does not fire, then you have one error in the script. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 12:32 PM |
| As I said, it fires 90% of the time, but sometimes not. And when it doesnt, output HAS NO errors. Like I already said. It just doesnt fire. The script also doesnt stop working, the event just doesnt fire. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Feb 2014 12:36 PM |
| Is it not working on online mode or play solo testing? |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 12:49 PM |
| My testing environment is a test Server and 2 test players |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 12:50 PM |
| but ive tested it online, where these bugs also happen |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Feb 2014 12:51 PM |
| It could be the way that Roblox loads in. Have you tried using some random :WaitForChild()'s for variables that don't load in instantly? |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 01:13 PM |
game.Players.PlayerAdded:connect(function(plr) print("Player "..plr.Name.."(userId: "..plr.userId..") joined the server")
even this print doesnt fire so I have no clue really.. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Feb 2014 01:14 PM |
| PlayerAdded doesn't work in play solo last time I checked? |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 01:16 PM |
| I said I tested it online :/ |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Feb 2014 01:19 PM |
| How are you using prints online/ |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 01:27 PM |
print = function(txt) local v = Instance.new("StringValue",workspace) v.Value = txt v.Name = "Log" end
print("omg")
then i have a script that checks for the values. Other stuff gets printed normally but playeradded just doesnt work, or even print |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 08 Feb 2014 01:29 PM |
ooooooooooh
game.Players.PlayerAdded:connect(function(plr) if plr then print ("yoloswag") else print ("well shucks") end print("Player "..plr.Name.."(userId: "..plr.userId..") joined the server") plr.TeamColor = BrickColor.new("White") updateGamefeed(plr.Name.." joined the server") local stats = game.ServerStorage.defplayer:clone() stats.Parent = script.Playerlist stats.Name = plr.Name plr.CharacterAdded:connect(function(c) --setAppearance(plr) local wp = rootDataStorage.Weapon:clone() wp.Parent = c repeat wait() until c:findFirstChild("Health") and c:findFirstChild("HealthScript v3.1") c["HealthScript v3.1"]:Destroy() c["Health"]:Destroy() end) end)
What does that print? |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 08 Feb 2014 01:51 PM |
>updateGamefeed()
I assume it has something to do with GUIs? Do you check if PlayerGui actually exists? Sometimes it loads fast, sometimes it does not. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 03:25 PM |
| If it wasnt there it would bring up an error, I get no errors :/ |
|
|
| Report Abuse |
|
|