Click play to end cutscene and spawn in

add this above the code

local SpawnPos = {
Postion#1 -- Remove this with positon#1 and add a ; after it and copy and paste it with all of the postions

}

and replace all of the Positions inside of the CFrame.new with this

Random.new(1, #SpawnPos)

Test this and see if it works

1 Like

Where would I place this in the script?

Above the script with the CFrame.new

Like this?:

The Table is in the correct area
but add this where you see “CFrame.new([])” (also delete the [])

Random.new(1, #SpawnPos)

Like this if this is correct:

That would be correct, now test to see if theres any errors

The camera did not switch to the player camera and the gui is still there.

In the other local script
did you fully connect the Tween function?

How would I check if I did that?

To connect a function you’ll put tween() to run the function

(and put this at the end of the script)

And what would I put at the end of the script?

image

At the end of your script you would place it

Like this if it goes under the camera script

put the loop or function that plays the cutscene inside a coroutine and connect your playbutton to a mousebutton1clicked event to close said coroutine

Can you record a video or take screenshots on how to do that please?

local CutsceneCoro = coroutine.create(function()
   --place your cutscene code here
end)

coroutine.resume(CutsceneCoro) -- Start running coroutine, they don't start by themselves

PlayButton.MouseButton1Click:Connect(function()
   coroutine.close(CutsceneCoro) -- Close the coroutine so it stops running your cutscene code
   --Place the code that spawns the player here
end)

Take a look at the docs
https://developer.roblox.com/en-us/api-reference/lua-docs/coroutine

1 Like