So I copied this guys code in youtube, so I can learn how to chat with NPCS and giving them a quest. I changed some stuff because some objects were named differently. But nothing is happening, when I click on the NPC, it just doesn't do anything like it ignored the coding. I copied what the guy did in every detail, but his works but not mine. Please take a look.

local Player = game.Player.LocalPlayer
local Character = Player.Character
local Camera = workspace.CurrentCamera
local CamPart = workspace.NPCS.Villager.CamPart
local clickdetector = workspace.NPCS.Villager.UpperTorso.ClickDetector
local chatline = script.Parent.ChatLine
local startquest = chatline.StartQuest
local startquest2 = chatline.StartQuest2
local close = chatline.Close
local billboard = workspace.NPCS.Villager.HumanoidRootPart.BillboardGui
local clicksound = script.Parent.ClickSound
local chatlineup = {0.042, 0},{0.604, 0}

clickdetector.MouseClick:Connect(function()
	clickdetector.MaxActivationDistance = 0
	billboard.Enabled = false
	startquest2.Visible = false
	startquest2.Active = false
	Camera.CameraType = Enum.CameraType.Scriptable
	if Camera.CameraType == Enum.CameraType.Scriptable then
		Camera.CFrame = CamPart.CFrame
		chatline:TweenPosition(UDim.new(chatlineup))
		local text = "Help! Our Village is being raided by bandits!"
		for i = 1, #text do
			chatline.Text = string.sub(text, 1, i)
			clicksound:Play()
			wait(.06)
		end
	end
	
end)

1 comment

0

if u just copy the text and dont interact with the parts in workspace, then something here and there will erro