From 13597aac468ad615a125c8f8bd76fedcfe961fbc Mon Sep 17 00:00:00 2001 From: ATHARVA CHAVAN <234417165+atharva-pc@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:50:53 +0530 Subject: [PATCH] solution for 17-hey-link Added methods for setting player name and talking. --- 4-objects/17-hey-link.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/4-objects/17-hey-link.lua b/4-objects/17-hey-link.lua index dc09d68..124ecaf 100644 --- a/4-objects/17-hey-link.lua +++ b/4-objects/17-hey-link.lua @@ -1,7 +1,6 @@ -- Hey Link! -- Codédex --- Player table Player = { name = "", x = 0, @@ -10,4 +9,22 @@ Player = { health = 100 } +-- Write code below 💖 +function Player:nameChar(username) + self.name = username + print("Name set to " .. self.name) +end + +function Player:talk() + print("Hello. My name is " .. self.name .. ". Let's begin!") +end + +-- This code will run once your functions are written! +Player:nameChar("Link") +Player:talk() + + +-- output +-- Name set to Link +-- Hello. My name is Link. Let's begin