How do I make a NPC chat?
The goal of this script is that when ever someone touch's the invisible block near the npc the npc will say G'day and then the players name who touched the block
01 | button = game.Workspace.Talk |
03 | function onTouch(other) |
04 | local human = other.Parent:FindFirstChild( "Humanoid" ) |
05 | if not human then return end |
06 | local player = game.Players:GetPlayerFromCharacter(other.Parent) |
07 | if not player then return end |
09 | game:GetService( "Chat" ):Chat(script.Parent, "G'Day" ..player.Name, color) |
12 | button.Touched:connect(onTouch) |