So I was making a revive system which has a cutscene that I implemented. But when I fired the event to the client, it wasn’t doing the cutscene as it’s supposed to be. It should be like this.
Not like this.
And here is the script.
local productFunctions = {}
productFunctions[2839291855] = function(player)
ReplicatedStorage.Events.Revive:FireClient(player)
player:LoadCharacter()
player:SetAttribute("Dead", nil)
local character = player.Character or player.CharacterAdded:Wait()
local room = generatedRooms[currentRoomNumber]
local cframe = room.Entrance.CFrame * CFrame.new(0,0,10) * CFrame.Angles(0, math.rad(180), 0)
character:PivotTo(cframe)
character:SetAttribute("MaxDoorReached", currentRoomNumber)
return true
end
MarketplaceService.ProcessReceipt = function(info)
local player = game.Players:GetPlayerByUserId(info.PlayerId)
if player then
local handler = productFunctions[info.ProductId]
local success, result = pcall(handler, player)
if success then
return Enum.ProductPurchaseDecision.PurchaseGranted
else
warn("bruh it failed", info, result)
end
end
return Enum.ProductPurchaseDecision.NotProcessedYet
end
Revive cutscene script.
local CameraShaker = require(game.ReplicatedStorage.Modules.Free.CameraShaker)
local magnitude = 3
local roughness = 5
local fadeInTime = 0
local fadeOutTime = 0.75
local posInfluence = 30
local rotInfluence = 100
game.ReplicatedStorage.Events.Revive.OnClientEvent:Connect(function()
local camera = workspace.CurrentCamera
local ts = game:GetService("TweenService")
local model = workspace.ReviveRoom
local startposition = model.Start.CFrame
local goalposition = model.Goal.CFrame
local transitiongui = game.Players.LocalPlayer.PlayerGui.TransitionGui
local frame = transitiongui.Frame
local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCf)
camera.CFrame = camera.CFrame * shakeCf
end)
camShake:Start()
frame.Transparency = 0
transitiongui.Enabled = true
frame.BackgroundColor3 = Color3.new(0,0,0)
ts:Create(frame, TweenInfo.new(0.75, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {Transparency = 1}):Play()
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = startposition
local tweeninfo = TweenInfo.new(2, Enum.EasingStyle.Cubic, Enum.EasingDirection.In)
local tween = ts:Create(camera, tweeninfo, {CFrame = goalposition})
tween:Play()
task.wait(1.5)
frame.BackgroundColor3 = Color3.new(1, 1, 1)
local fade = ts:Create(frame, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {Transparency = 0})
fade:Play()
fade.Completed:Wait()
camera.CameraType = Enum.CameraType.Custom
ts:Create(frame, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {Transparency = 1}):Play()
camShake:ShakeOnce(magnitude, roughness, fadeInTime, fadeOutTime, posInfluence, rotInfluence)
end)