generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: PlayerAdded and CameraMode

Previous Thread :: Next Thread 
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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 is not online. 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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
08 Feb 2014 08:34 AM
Im feeling uncomfortable posting over 2000 lines..
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
08 Feb 2014 09:12 AM
bump..
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
08 Feb 2014 09:49 AM
bump..........
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
08 Feb 2014 09:58 AM
if playeradded does not fire, then you have one error in the script.
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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 is not online. 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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
08 Feb 2014 12:49 PM
My testing environment is a test Server and 2 test players
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
08 Feb 2014 12:50 PM
but ive tested it online, where these bugs also happen
Report Abuse
Zkiller11 is not online. 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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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 is not online. 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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
08 Feb 2014 01:16 PM
I said I tested it online :/
Report Abuse
Zkiller11 is not online. Zkiller11
Joined: 25 Aug 2009
Total Posts: 2914
08 Feb 2014 01:19 PM
How are you using prints online/
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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 is not online. 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 is not online. 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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
08 Feb 2014 03:25 PM
If it wasnt there it would bring up an error, I get no errors :/
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image