I don’t really know how to use Player.cameramode do I have to run it on the server?
Here is my code
local Player = game:GetService("Players").LocalPlayer
local Uis = game:GetService("UserInputService")
local firstperson = true
Uis.InputBegan:Connect(function(input, g)
if g then return else end
if input.KeyCode == Enum.KeyCode.Q then
if firstperson then
firstperson = false
Player.CameraMode = Enum.CameraMode.Classic
print("Third person")
else
firstperson = true
Player.CameraMode = Enum.CameraMode.LockFirstPerson
print("First person")
end
end
end)
local Player = game:GetService("Players").LocalPlayer
local Uis = game:GetService("UserInputService")
Uis.InputBegan:Connect(function(input, g)
if g then return else end
if input.KeyCode == Enum.KeyCode.Q then
if Player.CameraMode = Enum.CameraMode.Classic then
Player.CameraMode = Enum.CameraMode.LockFirstPerson
else
Player.CameraMode = Enum.CameraMode.Classic
end
end
end)
local Player = game:GetService("Players").LocalPlayer
local Uis = game:GetService("UserInputService")
Uis.InputBegan:Connect(function(input, g)
if g then return else end
if input.KeyCode == Enum.KeyCode.Q then
if Player.CameraMode == Enum.CameraMode.Classic then
Player.CameraMode = Enum.CameraMode.LockFirstPerson
else
Player.CameraMode = Enum.CameraMode.Classic
end
end
end)
local Player = game:GetService("Players").LocalPlayer
local Uis = game:GetService("UserInputService")
local Remote = game:GetService("ReplicatedStorage").RemoteEvent
Uis.InputBegan:Connect(function(input, g)
if g then return else end
if input.KeyCode == Enum.KeyCode.Q then
if Player.CameraMode == Enum.CameraMode.Classic then
Remote:FireServer(Enum.CameraMode.LockFirstPerson)
else
Remote:FireServer(Enum.CameraMode.Classic)
end
end
end)
Server
local Remote = game:GetService("ReplicatedStorage").RemoteEvent
Remote.OnServerEvent:Connect(function(Player, Mode)
Player.CameraMode = Mode
end)```
---Doesn't work