Starter Project : [Download Starter Project]
Slides : [Slides Project]
Quest Item
-- VARIABLE --
local replicatedStorage = game:GetService("ReplicatedStorage")
local item = script.Parent
local clickDetector = item.ClickDetector
-- FUNCTION / MAIN CODE --
function gather(player)
item:Destroy()
replicatedStorage[item.Name].Value = true
local mission = player.PlayerGui.MissionGui.MainFrame.MissionFrame[item.Name]
mission:Destroy()
end
-- EVENT / CONNECTION --
clickDetector.MouseClick:Connect(gather)
Normal Dialogue
-- VARIABLE --
local chatService = game:GetService("Chat")
local replicatedStorage = game:GetService("ReplicatedStorage")
local npc = script.Parent
local prompt = npc.HumanoidRootPart.ProximityPrompt
local head = npc.Head
-- FUNCTION / MAIN CODE --
function talk(player)
prompt.Enabled = false
chatService:Chat(head, "tulis chat disini")
wait(6) -- waktu menunggu antar chat/waktu menunggu bisa di klik lagi
chatService:Chat(head, "kalau butuh chat tambahan, delete line ini jika tidak diperlukan")
wait(6) -- delete saja jika tidak dipakai
prompt.Enabled = true
end
-- EVENT --
prompt.Triggered:Connect(talk)
Quest Dialogue
-- VARIABLE --
local chatService = game:GetService("Chat")
local replicatedStorage = game:GetService("ReplicatedStorage")
local npc = script.Parent
local prompt = npc.HumanoidRootPart.ProximityPrompt
local head = npc.Head
-- FUNCTION / MAIN CODE --
function talk(player)
if replicatedStorage[npc.Name].Value == true then return end
prompt.Enabled = false
chatService:Chat(head, "ganti chat")
wait(8)
chatService:Chat(head, "ganti chat")
wait(8)
chatService:Chat(head, "ganti chat")
wait(8)
chatService:Chat(head, "ganti chat")
prompt.Enabled = true
local mission = player.PlayerGui.MissionGui.MainFrame.MissionFrame:FindFirstChild(npc.Name)
if not mission then return end
if mission.Visible == false then
mission.Visible = true
end
end
-- EVENT / CONNECTION --
prompt.Triggered:Connect(talk)