Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- params : ...
- local p = game.Players.LocalPlayer
- local m = p:GetMouse()
- repeat
- repeat
- wait()
- until p.Character
- until p.Character:FindFirstChild("Humanoid")
- local c = p.Character
- local h = c.Humanoid
- local interaction = "None"
- local talking = false
- local data = game.ReplicatedStorage.DataHolder[p.UserId].Data
- local MarketplaceService = game:GetService("MarketplaceService")
- Interact = function(interaction)
- if talking then
- return
- end
- local part = m.Target
- if part and part:FindFirstChild("Touch") and p.Character:FindFirstChild("HumanoidRootPart") then
- local d = part.Position - p.Character.HumanoidRootPart.Position.magnitude
- local max = 25
- if d <= max then
- if part:FindFirstChild("NPC") then
- if part:FindFirstChild("GrimoireWizard") then
- do
- if data.Quest.Value == 2 then
- local quest = "Start"
- game.ReplicatedStorage.Events.Quest:FireServer(quest)
- end
- script.Parent.Dialog.NPC.TextLabel.Text = "Grimoire Wizard"
- local t = "Hello, traveller. Would you like me to use my magic to give you your grimoire?"
- script.Parent.Dialog.Visible = true
- talking = true
- do
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- script.Parent.Dialog.Yes.Visible = true
- script.Parent.Dialog.No.Visible = true
- if part:FindFirstChild("Yuno") then
- script.Parent.Dialog.NPC.TextLabel.Text = "Yuno"
- local t = "Hey, I lost my Grimoire. Can you please help me find it?"
- script.Parent.Dialog.Visible = true
- talking = true
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- script.Parent.Dialog.Yes.Visible = true
- script.Parent.Dialog.No.Visible = true
- else
- do
- if part:FindFirstChild("Asta") then
- script.Parent.Dialog.NPC.TextLabel.Text = "Asta"
- local t = "HEEEY! WANNA HELP ME BEAT UP SOME LOGS?!"
- script.Parent.Dialog.Visible = true
- talking = true
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- script.Parent.Dialog.Yes.Visible = true
- script.Parent.Dialog.No.Visible = true
- else
- do
- if part:FindFirstChild("Yami") then
- script.Parent.Dialog.NPC.TextLabel.Text = "Yami"
- local t = "Yo noob, wanna join my guild?"
- script.Parent.Dialog.Visible = true
- talking = true
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- script.Parent.Dialog.Yes.Visible = true
- script.Parent.Dialog.No.Visible = true
- end
- do
- if part:FindFirstChild("Item") and part:FindFirstChild("YunoGrimoire") and part.Enabled.Value == true and data.Quest.Value == 1 then
- local quest = "Yuno"
- game.ReplicatedStorage.Events.Quest:FireServer(quest, part)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- Yes = function()
- script.Parent.Dialog.Yes.Visible = false
- script.Parent.Dialog.No.Visible = false
- if script.Parent.Dialog.NPC.TextLabel.Text == "Grimoire Wizard" then
- if data.Clover.Value == 0 and data.Type.Value == "None" then
- local a = math.random(1, 1000)
- local b = 0
- print(a)
- if a < 930 then
- b = 3
- else
- if a >= 930 and a < 999 then
- b = 4
- else
- if a >= 999 and a < 1000 then
- b = 5
- end
- end
- end
- local c = "None"
- if b == 3 or b == 4 then
- a = math.random(1, 5)
- if a == 1 then
- c = "Fire"
- else
- if a == 2 then
- c = "Water"
- else
- if a == 3 then
- c = "Wind"
- else
- if a == 4 then
- c = "Dark"
- else
- if a == 5 then
- c = "Light"
- end
- end
- end
- end
- end
- else
- if b == 5 then
- a = math.random(1, 1)
- if a == 1 then
- c = "Anti Magic"
- end
- end
- end
- local t = "Okay, first I\'ll check how many clover your grimoire has."
- local l = string.len(t)
- game.ReplicatedStorage.Events.GetGrimoire:FireServer(b, c)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- local t = "You got a " .. b .. " clover grimoire."
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- local t = "Now I\'ll check what kind of grimoire it is."
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- local t = "Your grimoire is the " .. c .. " type."
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- script.Parent.Dialog.Visible = false
- talking = false
- game.ReplicatedStorage.Events.RespawnPlayer:FireServer()
- else
- do
- local t2 = "You already have a grimoire. I can reset your grimoire using my magic."
- do
- local l2 = string.len(t2)
- for i = 1, l2 do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t2, 1, i)
- wait()
- end
- MarketplaceService:PromptProductPurchase(p, 119865441)
- wait(3)
- script.Parent.Dialog.Visible = false
- talking = false
- do return end
- if script.Parent.Dialog.NPC.TextLabel.Text == "Yuno" then
- local t = "Thanks, good luck."
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- local Quest = 1
- game.ReplicatedStorage.Events.StartQuest:FireServer(Quest)
- script.Parent.Dialog.Visible = false
- talking = false
- else
- do
- if script.Parent.Dialog.NPC.TextLabel.Text == "Asta" then
- local t = "HELLLL YEEEEAAAAAAAH!"
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- local Quest = 3
- game.ReplicatedStorage.Events.StartQuest:FireServer(Quest)
- script.Parent.Dialog.Visible = false
- talking = false
- else
- do
- if script.Parent.Dialog.NPC.TextLabel.Text == "Yami" then
- if data.Lv.Value >= 15 then
- local t = "Welcome to the guild, noob."
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- local Guild = "Black Bulls"
- game.ReplicatedStorage.Events.JoinGuild:FireServer(Guild)
- script.Parent.Dialog.Visible = false
- talking = false
- else
- do
- local t = "You\'re too weak, reach Lv. 15 first."
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- script.Parent.Dialog.Visible = false
- talking = false
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- No = function()
- script.Parent.Dialog.Yes.Visible = false
- script.Parent.Dialog.No.Visible = false
- if script.Parent.Dialog.NPC.TextLabel.Text == "Grimoire Wizard" then
- local t = "Well, why did you talk to me in the first place then?"
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- script.Parent.Dialog.Visible = false
- talking = false
- else
- do
- if script.Parent.Dialog.NPC.TextLabel.Text == "Yuno" then
- local t = "Wow, you\'re mean."
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- script.Parent.Dialog.Visible = false
- talking = false
- else
- do
- if script.Parent.Dialog.NPC.TextLabel.Text == "Yami" then
- local t = "How dare you say no to me?!?"
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- script.Parent.Dialog.Visible = false
- talking = false
- else
- do
- if script.Parent.Dialog.NPC.TextLabel.Text == "Asta" then
- local t = "OKAY, COME BACK AGAIN!"
- local l = string.len(t)
- for i = 1, l do
- script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
- wait()
- end
- wait(3)
- script.Parent.Dialog.Visible = false
- talking = false
- end
- end
- end
- end
- end
- end
- end
- end
- Detect = function()
- local part = m.Target
- if part and part:FindFirstChild("Touch") and p.Character:FindFirstChild("HumanoidRootPart") then
- if part:FindFirstChild("Enabled") and part.Enabled.Value == false then
- return
- end
- local d = part.Position - p.Character.HumanoidRootPart.Position.magnitude
- local max = 25
- if d <= max then
- if part:FindFirstChild("Description") then
- script.Parent.Frame.Frame.TextLabel.Text = part.Description.Value
- else
- script.Parent.Frame.Frame.TextLabel.Text = "???"
- end
- if part:FindFirstChild("NPC") then
- interaction = "NPC"
- script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to talk"
- else
- if part:FindFirstChild("Item") then
- interaction = "Item"
- script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to pick up"
- else
- if part:FindFirstChild("Shop") then
- interaction = "Shop"
- script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to buy"
- end
- end
- end
- script.Parent.Frame.Visible = true
- script.Parent.Frame.Position = UDim2.new(0, m.X, 0, m.Y)
- else
- script.Parent.Frame.Visible = false
- end
- else
- do
- script.Parent.Frame.Visible = false
- end
- end
- end
- m.Move:connect(function()
- Detect()
- end)
- m.Button1Down:connect(function()
- Interact()
- end)
- script.Parent.Dialog.Yes.TextButton.MouseButton1Down:connect(function()
- Yes()
- end)
- script.Parent.Dialog.No.TextButton.MouseButton1Down:connect(function()
- No()
- end)
- while wait(1) do
- Detect()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement