Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Need help fixing this please?

This is my starter script:

game.Players.PlayerAdded:connect(function(plr) 

  plr.CameraMode = "LockFirstPerson" 
 
end) 

game.StarterGui:SetCoreGuiEnabled("Backpack", false)

Basically it's meant to force player to FP and get rid of the backpack. In solo mode on studio It works fine but doesn't work in game. Anything I'm doing wrong?

2 answers

Use this

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		plr.CameraMode = "LockFirstPerson"
	end)
end)

basically it'll only set the camera mode when the character is added to the game, because the camera is focussed on the humanoid, if you set it before the character is added it won't do anything.

3 comments

0

Works in studio but doesn't seem to work otherwise, but thanks http://www.roblox.com/Gone-but-not-forgotten-In-early-stages-place?id=140812462

0

I tested this using studio's server but wasn't able to test it online, this should work fine...

0

Are you meant to put it in a local script? Could be what i've been doing wrong.....

Scripts are really sensitive when it comes to correct grammar and spelling. Try using the proper capitalises.

Game.Players.PlayerAdded:connect(function(plr)

Plr.CameraMode = "LockFirstPerson"

end)

Game.StarterGui:SetCoreGuiEnabled("Backpack", false)

2 comments

0

Still seems to not work. see what you think, cos I am not sure http://www.roblox.com/item.aspx?id=140812462

0

Completely incorrect

This discussion is preserved as it was. New answers, comments, and votes are closed.