Hello developers,
I want to put a cutscene in my game, but only playing it the first time a player joins.
How can I do that?
Thank you
Hello developers,
I want to put a cutscene in my game, but only playing it the first time a player joins.
How can I do that?
Thank you
You could use the DataStoreService
to save whether the cutscene has been played for the player or not.
-- where 'player' is the player object
local ds = game:GetService("DataStoreService")
local store = ds:GetDataStore("CutscenePlayed")
local playEvent = game.ReplicatedStorage.PlayCutscene
--then, when needed:
local played
local success, err = pcall(function()
played = store:GetAsync() --whatever you use to access the store
end)
if not played and success then
playEvent:FireClient(player)
end
--error handling code goes here
Then, have the client manage the cutscene with the RemoteEvent
.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.