#script not working as it should

25 messages · Page 1 of 1 (latest)

twilit mountain
#

you might see that i am trying to make the person lock into FP mode, but when i inserted the script, it would lock in even on the gui, who cna help me fix this?

#

ping me when/if you have found the problem

lean basalt
#

wdym?

#

whats the problem?

#

so like it goes in first person

terse phoenix
lean basalt
#

but it doesnt allow the mouse to move

lean basalt
#

@twilit mountain

twilit mountain
#

hello

lean basalt
twilit mountain
#

ok

#

so

#

i put a first person script on

#

so ur always in FPS mode

#

and

lean basalt
#

yes

twilit mountain
#

i dont want it in first person while ur on the gui

#

this was the original script

#

local function SetCameraSubject(player)
if player and player.Character then
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
game:GetService("Workspace").CurrentCamera.CameraSubject = humanoid
end
end
end

local function EnableFirstPerson(player)
if player then
player.CameraMode = Enum.CameraMode.LockFirstPerson
end
end

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid")
EnableFirstPerson(player)
SetCameraSubject(player)
end)
end)

game.Players.PlayerRemoving:Connect(function(player)
player.CameraMode = Enum.CameraMode.Classic
end)

for _, player in ipairs(game.Players:GetPlayers()) do
player.CameraMode = Enum.CameraMode.LockFirstPerson
SetCameraSubject(player)
end

lean basalt
#

there is some property on GUI that makes it so the mouse can move freely in first person mode whenever the gui with the property set to true is visible

twilit mountain
#

so what do i have to do

lean basalt
#

enable that

#

i think its called modal or something like that

#

or maybe active or smth