Hello
I currently have 2 script written, a local script that changes the camera to a part;
local player = game.Players.LocalPlayer
local character = player.CharacterAdded
local mouse = player:GetMouse()
local camera = game.Workspace.CurrentCamera
local defaultCFrame = camera.CFrame
local view = 150
function updateCamera()
camera.CFrame = game.Workspace.HomeCamera.CFrame
end
game:GetService("RunService").RenderStepped:Connect(updateCamera)
and a normal script, which teleports a player to a chosen position.
local pad = workspace.pad2
local localplayer = game.Players.LocalPlayer
local localui = localplayer.PlayerGui
local screengui = localui.ScreenGui
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local CurrentlyTeleporting = player.Character:FindFirstChild("CurrentlyTeleporting")
if not CurrentlyTeleporting then return end
if not CurrentlyTeleporting.Value then
CurrentlyTeleporting.Value = true
player.Character.HumanoidRootPart.CFrame = pad.CFrame + Vector3.new(0, 5, 0)
wait(3)
CurrentlyTeleporting = false
end
end
end)
both scripts work, but it would be nice to have them in a same script, making it more organised. I will also add a black screen which will fade in when the pad is touched, and fade out after around 1 second. After that the camera should be changed to the part as specified in the localscript.
Ofcourse its possible to time both scripts to work simultaniously, but it would be nicer to have them in the same script.
Does anyone know how I would do this? Or is it not possible?