Can anyone help me?

So i am making a game and i am here to ask how to make that when i activate a proximity prompt i get teleported, have a black screen for certain amount of seconds and it changes the camera to LockFirstPerson can somebody help me?

Hey! I can certainly try to help you.

Well there are two parts here, first the ProximityPrompt & secondly the teleporting. Are you trying to teleport to a part or a position?.

The black screen is going to be a simple UI script, you can probably throw a tween in there if you wanted to make it look nice.

For First Person, you’d set the CameraMode from Classic to LockFirstPerson.

I’ve provided documentation for these things, let me know if you need me to help you further although I won’t spoonfeed you it.

Good luck!

2 Likes

i did the teleporting and black screen (without tweening) this is the code so far:

local StarterGui = game:GetService(“StarterGui”)
local TransitionGui = StarterGui:FindFirstChild(“TransitionGui”)
local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
player.Character.HumanoidRootPart.Position = workspace.Inside.Position
TransitionGui.Enabled = true
end)

idk what i did wrong that it doesn’t work beacuse i don’t have any errors in the output (the teleport works)

You are using, StarterGui instead of the PlayerGui. You should detect the TransitionGui like this:

game.Players.LocalPlayer.PlayerGui:FindFirstChild("TransitionGui")

StarterGui is like StarterPack, you “Start” the game and the instances in these folders are being given to the player.

1 Like

ok so i got an error in the output then i pasted it in google and got a fix for it! now the black screen is working perfectly!

1 Like

ok i figured out how to do it all! thanks alot!

unfortunatly i still have a problem everything works but when i try too much it glitches out and i cannot use it anymore

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.CameraMaxZoomDistance = 7
player.CameraMinZoomDistance = 7
player.PlayerGui.TransitionGui.Enabled = true
wait(1)
player.PlayerGui.TransitionGui.Enabled = false
end
end)

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.CameraMaxZoomDistance = 7
player.CameraMinZoomDistance = 7
player.PlayerGui.TransitionGui.Enabled = true
wait(1)
player.PlayerGui.TransitionGui.Enabled = false
end
end)

there is no light in the output so i don’t know what to do to fix it