Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.0-flash-001· GoogleHugging Face LMArena Human Preference 140K

how to do step 2

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514’s answer.
  1. User

    how to do step 2

  2. Gemini Assistant

    Okay, let's break down Step 2: Scripting the Cinematic, as described in the previous response. We'll create the LocalScript, populate it with code, and understand the key functions.

    Step 2: Scripting the Cinematic

    1. Create a LocalScript:

      • In the Explorer window, find StarterPlayer. Then, expand it to find StarterPlayerScripts.

      • Right-click on StarterPlayerScripts and select "Insert Object".

      • Choose "LocalScript". Rename it to something descriptive, like "CinematicScript".

    2. Open the Script for Editing:

      • Double-click on the "CinematicScript" in the Explorer window. This opens the script editor where you'll write your code.
    3. Copy and Paste the Code:

      • Copy the Lua code from the previous response, or the modified version you're working on.

      • Paste it into the "CinematicScript" in the script editor.

    -- Services
    local Players = game:GetService("Players")
    local RunService = game:GetService("RunService")
    
    -- Variables
    local player = Players.LocalPlayer
    local character = player.Character or player.CharacterAdded:Wait() --Wait for character to load
    local camera = game.Workspace.CurrentCamera
    
    -- Assuming parents and house are already referenced, for simplicity, let's create them
    local parent1 = game.Workspace.Parent1
    local parent2 = game.Workspace.Parent2
    local house = game.Workspace.House
    
    -- Cinematic Functions
    local function moveCamera(position, duration)
        local startPosition = camera.CFrame
        local endPosition = CFrame.new(position)
        for t = 0, 1, RunService.RenderStepped:Wait() do
            camera.CFrame = startPosition:Lerp(endPosition, t / duration)
        end
    end
    
    local function playAnimation(character, animationName)
        local animation = character.Humanoid:LoadAnimation(character:FindFirstChild(animationName))
        animation:Play()
    end
    
    -- The story
    local function startCinematic()
        -- Move camera to outside the house
        moveCamera(house.Position + Vector3.new(0, 5, -10), 2)
    
        -- Character approaches the house
        character.Humanoid.WalkSpeed = 1.5
        character.Humanoid:MoveTo(house.Position)
        wait(3)
    
        -- Character knocks on the door
        playAnimation(character, "KnockDoor") -- Assuming you have a KnockDoor animation
    
        -- Parents appear at the door
        parent1.Humanoid:MoveTo(house.Position + Vector3.new(0, 0, 1))
        parent2.Humanoid:MoveTo(house.Position + Vector3.new(0, 0, 1))
        wait(1)
    
        -- Rejection dialogue and character gets kicked out
        playAnimation(parent1, "Reject") -- Assuming you have animations for rejection and anger
        playAnimation(parent2, "Reject")
    
        -- Character reacts
        playAnimation(character, "SadReaction")
    
        -- Character gets kicked out
        character.Humanoid:MoveTo(house.Position + Vector3.new(-5, 0, 0))
        moveCamera(character.HumanoidRootPart.Position - Vector3.new(0, 0, 5), 2)
    
        -- End cinematic
        print("Cinematic ended")
    end
    
    -- Start the cinematic when the game starts
    startCinematic()
    
    1. Important Code Explanation

      • Services: This section fetches frequently used Roblox services for easier access.

        local Players = game:GetService("Players")
        local RunService = game:GetService("RunService")
        
      • Variables: This section gets references to the player, character, and camera. It's important to have the character loaded.

        local player = Players.LocalPlayer
        local character = player.Character or player.CharacterAdded:Wait()
        local camera = game.Workspace.CurrentCamera
        
      • moveCamera(position, duration): This function smoothly moves the camera from its current position to a specified position over a duration in seconds.

        local function moveCamera(position, duration)
            local startPosition = camera.CFrame
            local endPosition = CFrame.new(position)
            for t = 0, 1, RunService.RenderStepped:Wait() do
                camera.CFrame = startPosition:Lerp(endPosition, t / duration)
            end
        end
        
      • playAnimation(character, animationName): This function loads and plays an animation on the specified character. It assumes that there's an Animation object named animationName parented to the character. This is where you'll need to put the animations you create in Step 3 into your character.

        local function playAnimation(character, animationName)
            local animation = character.Humanoid:LoadAnimation(character:FindFirstChild(animationName))
            animation:Play()
        end
        
      • startCinematic(): This function defines the sequence of events in your cinematic. It uses the moveCamera() and playAnimation() functions to create the cinematic moments. You will have to adjust the positions to match your setup in step 1.

      • player.Character or player.CharacterAdded:Wait() waits for the character to load before it runs the cinematic.

      • local parent1 = game.Workspace.Parent1 makes sure that the script is correctly referencing the parent characters.

    2. Addressing Potential Issues:

      • Character Loading: The player's character may not be immediately available when the script starts. Using player.Character or player.CharacterAdded:Wait() as shown above in the character variable line helps ensure the script waits until the character is loaded.

      • Object References: The script assumes that the objects (house, parents, etc.) are directly in game.Workspace and that they exist and are spelled correctly. Double-check that these names match the names you gave them in Step 1. If the parents or house are nil (do not exist), then the script will error.

    3. Test the Script:

      • Press the "Play" button in Roblox Studio to test your game.

      • Watch the Output window (View -> Output) for any error messages. Fix any errors that appear.

    4. Iterate and Refine:

      • Run the script and observe the cinematic.
      • Adjust the camera positions, animation names, character movements, and timings as needed to create the desired effect.
      • This iterative process is crucial for getting the cinematic just right.

    This detailed breakdown should help you get the script set up and running. Remember to carefully check the error messages in the Output window, as they provide valuable clues for debugging. Good luck! Let me know if any errors arise.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.