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 » Game Design
Home Search
 

Re: Help with FPS Plugin (by roblox)

Previous Thread :: Next Thread 
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 02:47 AM
I want to use it for a test game i'm making BUT I want vehicles and the first person lock makes them hard to drive, i'd appreciate any help with finding a way to remove the lock. (P.S I have no experience in scripting what so ever)
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 03:36 AM
local Player = game.Players.LocalPlayer

Player.Character:WaitForChild('Humanoid').Changed:connect(function()
local h = Player.Character.Hum

if h.Sit == true then
Player.CameraMode = Enum.CameraMode.Classic
else
Player.CameraMode = Enum.CameraMode.LockFirstPerson
end
end)




Put this in a localscript inside StarterPlayerScripts
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 05:32 AM
What "local script" do I put this into and where? I see a script called CameraScript inside StarterPlayerScripts
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 05:34 AM
the script inside camera scripts is: local RunService = game:GetService('RunService')
local UserInputService = game:GetService('UserInputService')
local PlayersService = game:GetService('Players')


local RootCamera = script:WaitForChild('RootCamera')
local ClassicCamera = require(RootCamera:WaitForChild('ClassicCamera'))()
local FollowCamera = require(RootCamera:WaitForChild('FollowCamera'))()
local PopperCam = require(script:WaitForChild('PopperCam'))
local Invisicam = require(script:WaitForChild('Invisicam'))
local ClickToMove = require(script:WaitForChild('ClickToMove'))()
local TransparencyController = require(script:WaitForChild('TransparencyController'))()
local StarterPlayer = game:GetService('StarterPlayer')

local GameSettings = UserSettings().GameSettings


local EnabledCamera = nil
local EnabledOcclusion = nil

local currentCameraConn = nil
local renderSteppedConn = nil


local function IsTouch()
return UserInputService.TouchEnabled
end

local function shouldUseCustomCamera()
local player = PlayersService.LocalPlayer
local currentCamera = workspace.CurrentCamera
if player then
if currentCamera == nil or (currentCamera and currentCamera.CameraType == Enum.CameraType.Custom) then
return true, player, currentCamera
end
end
return false, player, currentCamera
end

local function isClickToMoveOn()
local customModeOn, player, currentCamera = shouldUseCustomCamera()
if customModeOn then
if IsTouch() then -- Touch
if player.DevTouchMovementMode == Enum.DevTouchMovementMode.ClickToMove or
(player.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice and GameSettings.TouchMovementMode == Enum.TouchMovementMode.ClickToMove) then
return true
end
else -- Computer
if player.DevComputerMovementMode == Enum.DevComputerMovementMode.ClickToMove or
(player.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice and GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove) then
return true
end
end
end
return false
end

local function getCurrentCameraMode()
local customModeOn, player, currentCamera = shouldUseCustomCamera()
if customModeOn then
if IsTouch() then -- Touch (iPad, etc...)
if isClickToMoveOn() then
return Enum.DevTouchMovementMode.ClickToMove.Name
elseif player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
local touchMovementMode = GameSettings.TouchCameraMovementMode
if touchMovementMode == Enum.TouchCameraMovementMode.Default then
return Enum.TouchCameraMovementMode.Follow.Name
end
return touchMovementMode.Name
else
return player.DevTouchCameraMode.Name
end
else -- Computer
if isClickToMoveOn() then
return Enum.DevComputerMovementMode.ClickToMove.Name
elseif player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
local computerMovementMode = GameSettings.ComputerCameraMovementMode
if computerMovementMode == Enum.ComputerCameraMovementMode.Default then
return Enum.ComputerCameraMovementMode.Classic.Name
end
return computerMovementMode.Name
else
return player.DevComputerCameraMode.Name
end
end
end
end

local function getCameraOcclusionMode()
local customModeOn, player, currentCamera = shouldUseCustomCamera()
if customModeOn then
return player.DevCameraOcclusionMode
end
end

local function Update()
if EnabledCamera then
EnabledCamera:Update()
end
if EnabledOcclusion then
EnabledOcclusion:Update()
end
if shouldUseCustomCamera() then
TransparencyController:Update()
end
end

local function SetEnabledCamera(newCamera)
if EnabledCamera ~= newCamera then
if EnabledCamera then
EnabledCamera:SetEnabled(false)
end
EnabledCamera = newCamera
if EnabledCamera then
EnabledCamera:SetEnabled(true)
end
end
end

local function OnCameraMovementModeChange(newCameraMode)
if newCameraMode == Enum.DevComputerMovementMode.ClickToMove.Name then
ClickToMove:Start()
SetEnabledCamera(nil)
TransparencyController:SetEnabled(true)
else
if newCameraMode == Enum.ComputerCameraMovementMode.Classic.Name then
SetEnabledCamera(ClassicCamera)
TransparencyController:SetEnabled(true)
elseif newCameraMode == Enum.ComputerCameraMovementMode.Follow.Name then
SetEnabledCamera(FollowCamera)
TransparencyController:SetEnabled(true)
else -- Our camera movement code was disabled by the developer
SetEnabledCamera(nil)
TransparencyController:SetEnabled(false)
end
ClickToMove:Stop()
end

local newOcclusionMode = getCameraOcclusionMode()
if EnabledOcclusion == Invisicam and newOcclusionMode ~= Enum.DevCameraOcclusionMode.Invisicam then
Invisicam:Cleanup()
end
if newOcclusionMode == Enum.DevCameraOcclusionMode.Zoom then
EnabledOcclusion = PopperCam
elseif newOcclusionMode == Enum.DevCameraOcclusionMode.Invisicam then
EnabledOcclusion = Invisicam
else
EnabledOcclusion = false
end

local success = pcall(function() local isAThing = RunService.BindToRenderStep end)
if not success then
if renderSteppedConn then
renderSteppedConn:disconnect()
end
renderSteppedConn = RunService.RenderStepped:connect(Update)
end
end

local function OnCameraTypeChanged(newCameraType)
if newCameraType == Enum.CameraType.Scriptable then
if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
end


local function OnCameraSubjectChanged(newSubject)
TransparencyController:SetSubject(newSubject)
end

local function OnNewCamera()
OnCameraMovementModeChange(getCurrentCameraMode())

local currentCamera = workspace.CurrentCamera
if currentCamera then
if currentCameraConn then
currentCameraConn:disconnect()
end
currentCameraConn = currentCamera.Changed:connect(function(prop)
if prop == 'CameraType' then
OnCameraMovementModeChange(getCurrentCameraMode())
OnCameraTypeChanged(currentCamera.CameraType)
elseif prop == 'CameraSubject' then
OnCameraSubjectChanged(currentCamera.CameraSubject)
end
end)

OnCameraSubjectChanged(currentCamera.CameraSubject)
OnCameraTypeChanged(currentCamera.CameraType)
end
end


local function OnPlayerAdded(player)
workspace.Changed:connect(function(prop)
if prop == 'CurrentCamera' then
OnNewCamera()
end
end)

player.Changed:connect(function(prop)
OnCameraMovementModeChange(getCurrentCameraMode())
end)

GameSettings.Changed:connect(function(prop)
OnCameraMovementModeChange(getCurrentCameraMode())
end)

local success = pcall(function() RunService:BindToRenderStep("cameraRenderUpdate",Enum.RenderPriority.Camera.Value,Update) end)
if not success then
if renderSteppedConn then
renderSteppedConn:disconnect()
end
renderSteppedConn = RunService.RenderStepped:connect(Update)
end

OnNewCamera()
OnCameraMovementModeChange(getCurrentCameraMode())
end

do
while PlayersService.LocalPlayer == nil do wait() end
OnPlayerAdded(PlayersService.LocalPlayer)
end
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 05:54 AM
I placed yours inside camerascript and it did nothing, also I found out the fp lock is in gamescript and some other scripts
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 05:59 AM
Make a different localscript.
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 06:03 AM
I click on localscript but nothing happens.
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 06:12 AM
nvm
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 06:18 AM
k so i put the local script in where you said BUT it didn't work
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 06:34 AM
I tested it before giving it to you. It worked.
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 06:36 AM
hmmm are you sure I place it in the starterscript thing?
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 06:38 AM
StarterScript, StarterGui, StarterPack any will work
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 06:44 AM
what should I do if it isn't working? And are you SURE you're using the FPS Plugin that was made by roblox?
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 06:47 AM
Could I take a look at the game by any chance?
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 06:51 AM
i could get you some screenshots, but of what?
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 06:52 AM
To see if the plugin constantly changes the camera mode to firstperson or something. I just change it classic when the player sits.
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 06:57 AM
how do i stop it from constantly switching to fp? It's prob what's happening.
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 06:58 AM
Check the scripts for a loop or event that constantly changes the camera mode.
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 07:03 AM
any ideas of what i'd type in the 'find' area to find loops or ect?
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 07:06 AM
.CameraMode
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 07:11 AM
https://gyazo.com/47849ed5b6b69e938ed996727a596073 out of all of them which do you think I should delete/do whatever to?
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 07:15 AM
ScoreFrame.GameGui is your best bet. Look for a loop that changes it or an event firing when the player is changed resetting it back to the first person mode no matter what.
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 07:19 AM
https://gyazo.com/a792113a1bb0c7270210c0664fd36578 is anything wrong with this? I don't know how to tell if there's a loop thingy or something, btw thanks for being so helpful this late at night
Report Abuse
SwagCuzYolo is not online. SwagCuzYolo
Joined: 31 Oct 2013
Total Posts: 1224
30 Dec 2015 07:21 AM
Not unless something is looping that outside of what I can see.
Report Abuse
turnipthebeat is not online. turnipthebeat
Joined: 23 Feb 2013
Total Posts: 68
30 Dec 2015 07:24 AM
do you recommend searching loop instead?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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