So i was doing a proximity prompt that makes you teleport into a certain block, makes your screen go black and change the camera type i don’t know what does that the script to work at rare times i don’t see anything in the output here are the scripts:
Inside Script:
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
player.Character.HumanoidRootPart.Position = workspace.OutSide.Position
for i, player in pairs(game.Players:GetPlayers()) do
player.CameraMode = “Classic”
player.PlayerGui.TransitionGui.Enabled = true
wait(1)
player.PlayerGui.TransitionGui.Enabled = false
end
end)
Outside script:
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
player.Character.HumanoidRootPart.Position = workspace.Inside.Position
for i, player in pairs(game.Players:GetPlayers()) do
player.CameraMode = “LockFirstPerson”
player.PlayerGui.TransitionGui.Enabled = true
wait(1)
player.PlayerGui.TransitionGui.Enabled = false
end
end)
please can someone help me with this?
1 Like
This could be why, if you’re wanting to change every Player’s CameraMode
, you’ll have to create a RemoteEvent
& place it inside ReplicatedStorage
which will transport communication between the client-server/server-client and etc

You can call FireAllClients()
to let the script know when to change the CameraMode
variable, then on a LocalScript
you can detect when that event gets sent using OnClientEvent
--Server
--Script 1?
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
player.Character.HumanoidRootPart.Position = workspace.OutSide.Position
Event:FireAllClients("Outside")
end)
--Script 2?
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
player.Character.HumanoidRootPart.Position = workspace.Inside.Position
Event:FireAllClients("Inside")
end)
--Client, this should be inside StarterPlayerScripts as a LocalScript
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local TransitionUI = PlayerGui:WaitForChild("TransitionGui")
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
Event.OnClientEvent:Connect(function(Type)
if Type == "Outside" then
Player.CameraMode = Enum.CameraMode.Classic
elseif Type == "Inside" then
Player.CameraMode = Enum.CameraMode.LockFirstPerson
end
TransitionUI.Enabled = true
wait(1)
TransitionUI.Enabled = false
end)
1 Like
nope. i still have the problem maybe it’s beacuse my max zoom and min zoom is at 7? cuz i locked it at 7
I highly doubt that’d be the case
Did you change everything I said? It should still work regardless, even just adding print statements would help debug the issue a bit further
i created the remote event into the replicated storage on the bricks there is a new script which is a normal script beacuse local script didn’t work i also made the local script in starterplayerscripts so idk what is wrong
i literally don’t understand i tried printing but when it didn’t work it also did not print so i don’t really know what to do
I suppose you’re trying to change camera mode and make the screen go black when a proximity prompt is triggered. Put the localscript under ProximityPrompt, and put the serverscript under ServerScriptService
edit: try using the debug tools too: Debugging | Roblox Creator Documentation
edit 2: also don’t use fireallclients in a localscript under proximity prompt. you need to fire clients in a server script
1 Like
but the script in “Inside” and the “Outside” are normal scripts bot local scripts
bot local scripts? what do you mean? Also rechecking your script, you put both the scripts in ProximityPrompt. try this
--inside proximityprompt, a localscript
local Event = game.ReplicatedStorage:WaitForChild("remoteEvent")
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
Event:FireServer(player)
end)
--server script
local Event = game.ReplicatedStorage:WaitForChild("Event")
local changeCameraMode = game.ReplicatedStorage:WaitForChild("changeCameraMode")
Event.OnServerEvent:Connect(function(player)
player.Character.HumanoidRootPart.Position = --bla bla bla
changeCameraMode:FireClient(player)
end)
then, when the server fires the client script like @JackscarIitt’s solution, you’ll need to change the camera mode.
i did the script in serverscriptservice did the position to Inside for testing but now it doesn’t work at all
(also i did that local script inside proximity prompt)