I want this script to work in-game, so I can get the perspective a player would receive. It works in Studio, but not when I publish it. Any help would be appreciated.
script.Parent.MouseButton1Click:Connect(function()
wait(14)
for i, player in pairs(AliveTeam:GetPlayers()) do
if player then
table.insert(tps,player)
end
end
for i, player in pairs(tps) do
if player then
character = player.Character
if character then
character:FindFirstChild("HumanoidRootPart").CFrame = LaunchroomSpots[1].CFrame * CFrame.new(0, 0, -1)
table.remove(LaunchroomSpots,1)
end
end
end
end)
If collaborative editing is enabled in game settings, then you will need to commit a draft of the script for it to work outside of studio. If so youâll find the drafts in the view tab, then you just need to click on your script and press commit
local event = game:GetService("ReplicatedStorage"):WaitForChild("ToPadRoomFade")
script.Parent.MouseButton1Click:Connect(function()
event:FireServer()
end)
local TweenService = game:GetService("TweenService")
local cam = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local cameratype = Enum.CameraType.Scriptable
local cameratypechanged = cam:GetPropertyChangedSignal("CameraType")
local pcamera = game.Workspace.PadRoomFromCamera
local campos = cam.CFrame.Position
local partpos = game.Workspace.exggs.Position
local cc = workspace.CurrentCamera
local tween1Rise = TweenService:Create(
cam,
TweenInfo.new(45, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
{
CFrame = CFrame.new(partpos) * CFrame.Angles(0,math.rad(-90),0)
}
)
local function IntroCam()
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = pcamera.CFrame
wait(2)
tween1Rise:Play()
wait(14.5)
tween1Rise:Pause()
end
script.Parent.MouseButton1Click:Connect(function()
wait(3)
IntroCam()
wait(5.5)
cc.CameraType = Enum.CameraType.Custom
local tplayer = player.Name
local human = workspace:FindFirstChild("tplayer")
cam.CFrame = human:WaitForChild("Head")
end)
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local press = script.Parent
local looking = false
local endCFrame = CFrame.new(-189.72, -465.1, 1167.355)
local tweentime = 12
local active = false
local LaunchroomSpots = game.Workspace.fromlaunch:GetChildren()
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local AliveTeam = Teams.Alive
local tps = {}
local ReplicatedStorage = game:GetService("ReplicatedStorage")
script.Parent.MouseButton1Click:Connect(function()
wait(14)
for i, player in pairs(AliveTeam:GetPlayers()) do
if player then
table.insert(tps,player)
end
end
for i, player in pairs(tps) do
if player then
character = player.Character
if character then
character:FindFirstChild("HumanoidRootPart").CFrame = LaunchroomSpots[1].CFrame * CFrame.new(0, 0, -1)
table.remove(LaunchroomSpots,1)
end
end
end
end)