Advertisement
iiFlamez

Untitled

Dec 1st, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.77 KB | None | 0 0
  1. -- params : ...
  2.  
  3. local p = game.Players.LocalPlayer
  4. local m = p:GetMouse()
  5. repeat
  6. repeat
  7. wait()
  8. until p.Character
  9. until p.Character:FindFirstChild("Humanoid")
  10. local c = p.Character
  11. local h = c.Humanoid
  12. local interaction = "None"
  13. local talking = false
  14. local data = game.ReplicatedStorage.DataHolder[p.UserId].Data
  15. local MarketplaceService = game:GetService("MarketplaceService")
  16. Interact = function(interaction)
  17. if talking then
  18. return
  19. end
  20. local part = m.Target
  21. if part and part:FindFirstChild("Touch") and p.Character:FindFirstChild("HumanoidRootPart") then
  22. local d = part.Position - p.Character.HumanoidRootPart.Position.magnitude
  23. local max = 25
  24. if d <= max then
  25. if part:FindFirstChild("NPC") then
  26. if part:FindFirstChild("GrimoireWizard") then
  27. do
  28. if data.Quest.Value == 2 then
  29. local quest = "Start"
  30. game.ReplicatedStorage.Events.Quest:FireServer(quest)
  31. end
  32. script.Parent.Dialog.NPC.TextLabel.Text = "Grimoire Wizard"
  33. local t = "Hello, traveller. Would you like me to use my magic to give you your grimoire?"
  34. script.Parent.Dialog.Visible = true
  35. talking = true
  36. do
  37. local l = string.len(t)
  38. for i = 1, l do
  39. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  40. wait()
  41. end
  42. script.Parent.Dialog.Yes.Visible = true
  43. script.Parent.Dialog.No.Visible = true
  44. if part:FindFirstChild("Yuno") then
  45. script.Parent.Dialog.NPC.TextLabel.Text = "Yuno"
  46. local t = "Hey, I lost my Grimoire. Can you please help me find it?"
  47. script.Parent.Dialog.Visible = true
  48. talking = true
  49. local l = string.len(t)
  50. for i = 1, l do
  51. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  52. wait()
  53. end
  54. script.Parent.Dialog.Yes.Visible = true
  55. script.Parent.Dialog.No.Visible = true
  56. else
  57. do
  58. if part:FindFirstChild("Asta") then
  59. script.Parent.Dialog.NPC.TextLabel.Text = "Asta"
  60. local t = "HEEEY! WANNA HELP ME BEAT UP SOME LOGS?!"
  61. script.Parent.Dialog.Visible = true
  62. talking = true
  63. local l = string.len(t)
  64. for i = 1, l do
  65. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  66. wait()
  67. end
  68. script.Parent.Dialog.Yes.Visible = true
  69. script.Parent.Dialog.No.Visible = true
  70. else
  71. do
  72. if part:FindFirstChild("Yami") then
  73. script.Parent.Dialog.NPC.TextLabel.Text = "Yami"
  74. local t = "Yo noob, wanna join my guild?"
  75. script.Parent.Dialog.Visible = true
  76. talking = true
  77. local l = string.len(t)
  78. for i = 1, l do
  79. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  80. wait()
  81. end
  82. script.Parent.Dialog.Yes.Visible = true
  83. script.Parent.Dialog.No.Visible = true
  84. end
  85. do
  86. if part:FindFirstChild("Item") and part:FindFirstChild("YunoGrimoire") and part.Enabled.Value == true and data.Quest.Value == 1 then
  87. local quest = "Yuno"
  88. game.ReplicatedStorage.Events.Quest:FireServer(quest, part)
  89. end
  90. end
  91. end
  92. end
  93. end
  94. end
  95. end
  96. end
  97. end
  98. end
  99. end
  100. end
  101. end
  102.  
  103. Yes = function()
  104. script.Parent.Dialog.Yes.Visible = false
  105. script.Parent.Dialog.No.Visible = false
  106. if script.Parent.Dialog.NPC.TextLabel.Text == "Grimoire Wizard" then
  107. if data.Clover.Value == 0 and data.Type.Value == "None" then
  108. local a = math.random(1, 1000)
  109. local b = 0
  110. print(a)
  111. if a < 930 then
  112. b = 3
  113. else
  114. if a >= 930 and a < 999 then
  115. b = 4
  116. else
  117. if a >= 999 and a < 1000 then
  118. b = 5
  119. end
  120. end
  121. end
  122. local c = "None"
  123. if b == 3 or b == 4 then
  124. a = math.random(1, 5)
  125. if a == 1 then
  126. c = "Fire"
  127. else
  128. if a == 2 then
  129. c = "Water"
  130. else
  131. if a == 3 then
  132. c = "Wind"
  133. else
  134. if a == 4 then
  135. c = "Dark"
  136. else
  137. if a == 5 then
  138. c = "Light"
  139. end
  140. end
  141. end
  142. end
  143. end
  144. else
  145. if b == 5 then
  146. a = math.random(1, 1)
  147. if a == 1 then
  148. c = "Anti Magic"
  149. end
  150. end
  151. end
  152. local t = "Okay, first I\'ll check how many clover your grimoire has."
  153. local l = string.len(t)
  154. game.ReplicatedStorage.Events.GetGrimoire:FireServer(b, c)
  155. for i = 1, l do
  156. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  157. wait()
  158. end
  159. wait(3)
  160. local t = "You got a " .. b .. " clover grimoire."
  161. local l = string.len(t)
  162. for i = 1, l do
  163. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  164. wait()
  165. end
  166. wait(3)
  167. local t = "Now I\'ll check what kind of grimoire it is."
  168. local l = string.len(t)
  169. for i = 1, l do
  170. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  171. wait()
  172. end
  173. wait(3)
  174. local t = "Your grimoire is the " .. c .. " type."
  175. local l = string.len(t)
  176. for i = 1, l do
  177. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  178. wait()
  179. end
  180. wait(3)
  181. script.Parent.Dialog.Visible = false
  182. talking = false
  183. game.ReplicatedStorage.Events.RespawnPlayer:FireServer()
  184. else
  185. do
  186. local t2 = "You already have a grimoire. I can reset your grimoire using my magic."
  187. do
  188. local l2 = string.len(t2)
  189. for i = 1, l2 do
  190. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t2, 1, i)
  191. wait()
  192. end
  193. MarketplaceService:PromptProductPurchase(p, 119865441)
  194. wait(3)
  195. script.Parent.Dialog.Visible = false
  196. talking = false
  197. do return end
  198. if script.Parent.Dialog.NPC.TextLabel.Text == "Yuno" then
  199. local t = "Thanks, good luck."
  200. local l = string.len(t)
  201. for i = 1, l do
  202. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  203. wait()
  204. end
  205. wait(3)
  206. local Quest = 1
  207. game.ReplicatedStorage.Events.StartQuest:FireServer(Quest)
  208. script.Parent.Dialog.Visible = false
  209. talking = false
  210. else
  211. do
  212. if script.Parent.Dialog.NPC.TextLabel.Text == "Asta" then
  213. local t = "HELLLL YEEEEAAAAAAAH!"
  214. local l = string.len(t)
  215. for i = 1, l do
  216. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  217. wait()
  218. end
  219. wait(3)
  220. local Quest = 3
  221. game.ReplicatedStorage.Events.StartQuest:FireServer(Quest)
  222. script.Parent.Dialog.Visible = false
  223. talking = false
  224. else
  225. do
  226. if script.Parent.Dialog.NPC.TextLabel.Text == "Yami" then
  227. if data.Lv.Value >= 15 then
  228. local t = "Welcome to the guild, noob."
  229. local l = string.len(t)
  230. for i = 1, l do
  231. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  232. wait()
  233. end
  234. wait(3)
  235. local Guild = "Black Bulls"
  236. game.ReplicatedStorage.Events.JoinGuild:FireServer(Guild)
  237. script.Parent.Dialog.Visible = false
  238. talking = false
  239. else
  240. do
  241. local t = "You\'re too weak, reach Lv. 15 first."
  242. local l = string.len(t)
  243. for i = 1, l do
  244. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  245. wait()
  246. end
  247. wait(3)
  248. script.Parent.Dialog.Visible = false
  249. talking = false
  250. end
  251. end
  252. end
  253. end
  254. end
  255. end
  256. end
  257. end
  258. end
  259. end
  260. end
  261. end
  262.  
  263. No = function()
  264. script.Parent.Dialog.Yes.Visible = false
  265. script.Parent.Dialog.No.Visible = false
  266. if script.Parent.Dialog.NPC.TextLabel.Text == "Grimoire Wizard" then
  267. local t = "Well, why did you talk to me in the first place then?"
  268. local l = string.len(t)
  269. for i = 1, l do
  270. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  271. wait()
  272. end
  273. wait(3)
  274. script.Parent.Dialog.Visible = false
  275. talking = false
  276. else
  277. do
  278. if script.Parent.Dialog.NPC.TextLabel.Text == "Yuno" then
  279. local t = "Wow, you\'re mean."
  280. local l = string.len(t)
  281. for i = 1, l do
  282. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  283. wait()
  284. end
  285. wait(3)
  286. script.Parent.Dialog.Visible = false
  287. talking = false
  288. else
  289. do
  290. if script.Parent.Dialog.NPC.TextLabel.Text == "Yami" then
  291. local t = "How dare you say no to me?!?"
  292. local l = string.len(t)
  293. for i = 1, l do
  294. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  295. wait()
  296. end
  297. wait(3)
  298. script.Parent.Dialog.Visible = false
  299. talking = false
  300. else
  301. do
  302. if script.Parent.Dialog.NPC.TextLabel.Text == "Asta" then
  303. local t = "OKAY, COME BACK AGAIN!"
  304. local l = string.len(t)
  305. for i = 1, l do
  306. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  307. wait()
  308. end
  309. wait(3)
  310. script.Parent.Dialog.Visible = false
  311. talking = false
  312. end
  313. end
  314. end
  315. end
  316. end
  317. end
  318. end
  319. end
  320.  
  321. Detect = function()
  322. local part = m.Target
  323. if part and part:FindFirstChild("Touch") and p.Character:FindFirstChild("HumanoidRootPart") then
  324. if part:FindFirstChild("Enabled") and part.Enabled.Value == false then
  325. return
  326. end
  327. local d = part.Position - p.Character.HumanoidRootPart.Position.magnitude
  328. local max = 25
  329. if d <= max then
  330. if part:FindFirstChild("Description") then
  331. script.Parent.Frame.Frame.TextLabel.Text = part.Description.Value
  332. else
  333. script.Parent.Frame.Frame.TextLabel.Text = "???"
  334. end
  335. if part:FindFirstChild("NPC") then
  336. interaction = "NPC"
  337. script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to talk"
  338. else
  339. if part:FindFirstChild("Item") then
  340. interaction = "Item"
  341. script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to pick up"
  342. else
  343. if part:FindFirstChild("Shop") then
  344. interaction = "Shop"
  345. script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to buy"
  346. end
  347. end
  348. end
  349. script.Parent.Frame.Visible = true
  350. script.Parent.Frame.Position = UDim2.new(0, m.X, 0, m.Y)
  351. else
  352. script.Parent.Frame.Visible = false
  353. end
  354. else
  355. do
  356. script.Parent.Frame.Visible = false
  357. end
  358. end
  359. end
  360.  
  361. m.Move:connect(function()
  362. Detect()
  363. end)
  364. m.Button1Down:connect(function()
  365. Interact()
  366. end)
  367. script.Parent.Dialog.Yes.TextButton.MouseButton1Down:connect(function()
  368. Yes()
  369. end)
  370. script.Parent.Dialog.No.TextButton.MouseButton1Down:connect(function()
  371. No()
  372. end)
  373. while wait(1) do
  374. Detect()
  375. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement