Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I fix this? my cutscene it isnt playing and i want it to play when only new players join

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)

3 comments

0

Where is the script located? StarterCharacterScripts?

0

Its located in serverscriptstorage

0

make a bool value in the players datastore and check if it is false then play the cutscene, change it to true after the cutscene is finished

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.