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: FPS Script!

Previous Thread :: Next Thread 
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 07:25 PM
I need a first person shooter script for my game, but i don't have a full grasp on how to make it. Help?
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 07:27 PM
anything will help!
Report Abuse
Mastermindperson is not online. Mastermindperson
Joined: 20 Jun 2011
Total Posts: 13531
11 Mar 2014 07:28 PM
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

i r teh pwnz0r!
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 07:29 PM
thank you! so all i do is make a script, and put this in it?
Report Abuse
Mastermindperson is not online. Mastermindperson
Joined: 20 Jun 2011
Total Posts: 13531
11 Mar 2014 07:30 PM
make a local script in starter gui

i r teh pwnz0r!
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
11 Mar 2014 07:34 PM
Or you could do:
repeat
script.Parent.Parent.CameraMode = "LockFirstPerson"
until script.Parent.Parent.CameraMode == "LockFirstPerson

and place it in the StarterPack, though it might lag a little, it works.
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 07:34 PM
So it will be...

starter GUI
local script-then what you said
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 07:35 PM
thanks that works too, il try both
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
11 Mar 2014 07:35 PM
Oops typo,

repeat
script.Parent.Parent.CameraMode = "LockFirstPerson"
until script.Parent.Parent.CameraMode == "LockFirstPerson"

it would have to be normal not local though.
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 07:38 PM
ok, so i put that into a script, and put the script into starter gui?
Report Abuse
Mastermindperson is not online. Mastermindperson
Joined: 20 Jun 2011
Total Posts: 13531
11 Mar 2014 07:39 PM
or stortor p@ck

i r teh pwnz0r!
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
11 Mar 2014 07:41 PM
repeat
script.Parent.Parent.CameraMode = "LockFirstPerson"
until script.Parent.Parent.CameraMode == "LockFirstPerson"

^Above will result in an infinite loop and crash.

Reason: no wait()
Also
CameraMode is an Enum
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 07:43 PM
so how do i fix it?
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
11 Mar 2014 07:47 PM
This is a mrore suffiecent way.



LFP = LockFirstPerson
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LFP
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
11 Mar 2014 07:48 PM
Above wont work either

LFP = "LockFirstPerson"
repeat wait()
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode[LFP]
until LFP = LockFirstPerson
game:GetService('Players').LocalPlayer.CameraMode == Enum.CameraMode[LFP]

That will.
Report Abuse
GRAGGER2001 is not online. GRAGGER2001
Joined: 05 Apr 2009
Total Posts: 2043
11 Mar 2014 07:54 PM
^ That also won't work.

LFP = "LockFirstPerson"
repeat wait()
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode[LFP]
until LFP == "LockFirstPerson" -- Remember you need two "=" for repeat until loops.
game:GetService('Players').LocalPlayer.CameraMode == Enum.CameraMode[LFP]

That will.
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
11 Mar 2014 07:56 PM
They took my advice on shortening to LFP :)
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
11 Mar 2014 08:27 PM
Thanks to all, but im confused. What will and wont work?
Report Abuse
Korimon is not online. Korimon
Joined: 07 Aug 2013
Total Posts: 56
11 Mar 2014 08:34 PM
Hehe, another typo

LFP = "LockFirstPerson"
repeat wait()
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode[LFP]
until LFP == "LockFirstPerson" -- Remember you need two "=" for repeat until loops.
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode[LFP]


Its "=" not "=="


Above will work.
Report Abuse
roblomuscleman900 is not online. roblomuscleman900
Joined: 28 May 2011
Total Posts: 14
11 Mar 2014 08:37 PM
yeah its hard and scripting is confusing. even dou i try my hardest to understand its too confusing
Report Abuse
roblomuscleman900 is not online. roblomuscleman900
Joined: 28 May 2011
Total Posts: 14
11 Mar 2014 08:38 PM
some one i nee dhelp with this
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
11 Mar 2014 08:49 PM
(I'm assuming you want to be in first person mode when you spawn and not when you click something)

Ok so create a script:

Place the script in the StarterPack.

Put this into the script.

repeat
wait(0.000001)
script.Parent.Parent.CameraMode = "LockFirstPerson"
until script.Parent.Parent.CameraMode = "LockFirstPerson

This will work as I have tried it before.
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
11 Mar 2014 08:50 PM
Yet I typo'd again,

Follow my last post and put this in the script.

repeat
wait(0.0001)
script.Parent.Parent.CameraMode = "LockFirstPerson"
until script.Parent.Parent.CameraMode == "LockFirstPerson"

There.
Report Abuse
TheAwsomerKid is not online. TheAwsomerKid
Joined: 14 Oct 2012
Total Posts: 133
12 Mar 2014 03:14 PM
Thank you
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