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