I actually am VERY new to scripting so i just used these from a couple devforums and I'm not sure why its not working because it seems somewhat logical to me:
local CoinsDataStore = game:GetService("DataStoreService"):GetDataStore("Coins") game.Players.PlayerAdded:connect(function(Player) local CoinData = CoinsDataStore:GetAsync(Player.UserId)
local Coins = Instance.new("IntValue") Coins.Name = "Money" local NewPlayer = false if CoinData ~= nil then Coins.Value = CoinData else NewPlayer = true CoinsDataStore:SetAsync(Player.UserId, 0) -- start new data end if NewPlayer = true then local TweenService = game:GetService("TweenService") local camera = game.Workspace.Camera local cutsceneTime = 12 local tweenInfo = TweenInfo.new( custsceneTime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0 ) function tween (part1,part2) camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = part1.CFrame local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame}) tween:play() wait(cutsceneTime) camera.CameraType = Enum.CameraType.Custom end wait(0) tween(game.Workspace.Cam1.game.Workspace.Cam2) end
end)
You can't get the players Camera
from the server, you would have to fire a RemoteEvent
from the server script to a local script in StarterPlayerScripts
(or StarterCharacterScripts
)