Advertisement
iiFlamez

Untitled

Dec 13th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.05 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. local ex = 2.3172389729187e+34
  17. Interact = function(interaction)
  18. if talking then
  19. return
  20. end
  21. local part = m.Target
  22. if part and part:FindFirstChild("Touch") and p.Character:FindFirstChild("HumanoidRootPart") then
  23. local d = part.Position - p.Character.HumanoidRootPart.Position.magnitude
  24. local max = 25
  25. if d <= max then
  26. if part:FindFirstChild("NPC") then
  27. if part:FindFirstChild("GrimoireWizard") then
  28. script.Parent.Dialog.NPC.TextLabel.Text = "Grimoire Wizard"
  29. local t = "Hello, traveller. Would you like me to use my magic to give you your grimoire?"
  30. script.Parent.Dialog.Visible = true
  31. talking = true
  32. local l = string.len(t)
  33. for i = 1, l do
  34. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  35. wait()
  36. end
  37. script.Parent.Dialog.Yes.Visible = true
  38. script.Parent.Dialog.No.Visible = true
  39. else
  40. do
  41. if part:FindFirstChild("Yuno") then
  42. script.Parent.Dialog.NPC.TextLabel.Text = "Yuno"
  43. local t = "Hey, I lost my Grimoire. Can you please help me find it?"
  44. script.Parent.Dialog.Visible = true
  45. talking = true
  46. local l = string.len(t)
  47. for i = 1, l do
  48. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  49. wait()
  50. end
  51. script.Parent.Dialog.Yes.Visible = true
  52. script.Parent.Dialog.No.Visible = true
  53. else
  54. do
  55. if part:FindFirstChild("Asta") then
  56. script.Parent.Dialog.NPC.TextLabel.Text = "Asta"
  57. local t = "HEEEY! WANNA HELP ME BEAT UP SOME LOGS?!"
  58. script.Parent.Dialog.Visible = true
  59. talking = true
  60. local l = string.len(t)
  61. for i = 1, l do
  62. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  63. wait()
  64. end
  65. script.Parent.Dialog.Yes.Visible = true
  66. script.Parent.Dialog.No.Visible = true
  67. else
  68. do
  69. if part:FindFirstChild("Yami") then
  70. script.Parent.Dialog.NPC.TextLabel.Text = "Yami"
  71. local t = "Yo noob, wanna join my guild?"
  72. script.Parent.Dialog.Visible = true
  73. talking = true
  74. local l = string.len(t)
  75. for i = 1, l do
  76. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  77. wait()
  78. end
  79. script.Parent.Dialog.Yes.Visible = true
  80. script.Parent.Dialog.No.Visible = true
  81. end
  82. do
  83. do
  84. if part:FindFirstChild("Item") and part:FindFirstChild("YunoGrimoire") and part.Enabled.Value == true and data.Quest.Value == 1 then
  85. local quest = "Yuno"
  86. game.ReplicatedStorage.Events.Quest:FireServer(quest, part, ex)
  87. end
  88. if part:FindFirstChild("Shop") then
  89. if part:FindFirstChild("Clothing1") then
  90. script.Parent.Dialog.NPC.TextLabel.Text = "White Coat"
  91. local t = "Would you like to buy the White Coat for 300$?"
  92. script.Parent.Dialog.Visible = true
  93. talking = true
  94. local l = string.len(t)
  95. for i = 1, l do
  96. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  97. wait()
  98. end
  99. script.Parent.Dialog.Yes.Visible = true
  100. script.Parent.Dialog.No.Visible = true
  101. else
  102. do
  103. if part:FindFirstChild("BlackBullsClothing") then
  104. script.Parent.Dialog.NPC.TextLabel.Text = "Black Bulls Uniform"
  105. local t = "Would you like to buy the Black Bulls Uniform for 0$?"
  106. script.Parent.Dialog.Visible = true
  107. talking = true
  108. local l = string.len(t)
  109. for i = 1, l do
  110. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  111. wait()
  112. end
  113. script.Parent.Dialog.Yes.Visible = true
  114. script.Parent.Dialog.No.Visible = true
  115. else
  116. do
  117. if part:FindFirstChild("Clothing2") then
  118. script.Parent.Dialog.NPC.TextLabel.Text = "Crimson Mage Armor"
  119. local t = "Would you like to buy the Crimson Mage Armor for 750$?"
  120. script.Parent.Dialog.Visible = true
  121. talking = true
  122. local l = string.len(t)
  123. for i = 1, l do
  124. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  125. wait()
  126. end
  127. script.Parent.Dialog.Yes.Visible = true
  128. script.Parent.Dialog.No.Visible = true
  129. end
  130. end
  131. end
  132. end
  133. end
  134. end
  135. end
  136. end
  137. end
  138. end
  139. end
  140. end
  141. end
  142. end
  143. end
  144. end
  145. end
  146. end
  147.  
  148. Yes = function()
  149. script.Parent.Dialog.Yes.Visible = false
  150. script.Parent.Dialog.No.Visible = false
  151. if script.Parent.Dialog.NPC.TextLabel.Text == "Grimoire Wizard" then
  152. if data.Clover.Value == 0 and data.Type.Value == "None" then
  153. local a = math.random(1, 1000)
  154. local b = 0
  155. print(a)
  156. if a < 930 then
  157. b = 3
  158. else
  159. if a >= 930 and a < 999 then
  160. b = 4
  161. else
  162. if a >= 999 and a < 1000 then
  163. b = 5
  164. end
  165. end
  166. end
  167. local c = "None"
  168. if b == 3 or b == 4 then
  169. a = math.random(1, 5)
  170. if a == 1 then
  171. c = "Fire"
  172. else
  173. if a == 2 then
  174. c = "Water"
  175. else
  176. if a == 3 then
  177. c = "Wind"
  178. else
  179. if a == 4 then
  180. c = "Dark"
  181. else
  182. if a == 5 then
  183. c = "Light"
  184. end
  185. end
  186. end
  187. end
  188. end
  189. else
  190. if b == 5 then
  191. a = math.random(1, 1)
  192. if a == 1 then
  193. c = "Anti Magic"
  194. end
  195. end
  196. end
  197. local t = "Okay, first I\'ll check how many clover your grimoire has."
  198. local l = string.len(t)
  199. local antiex = 3.2987639862184e+31
  200. game.ReplicatedStorage.Events.GetGrimoire:FireServer(b, c, antiex)
  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 t = "You got a " .. b .. " clover grimoire."
  207. local l = string.len(t)
  208. for i = 1, l do
  209. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  210. wait()
  211. end
  212. wait(3)
  213. local t = "Now I\'ll check what kind of grimoire it is."
  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 t = "Your grimoire is the " .. c .. " type."
  221. local l = string.len(t)
  222. for i = 1, l do
  223. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  224. wait()
  225. end
  226. wait(3)
  227. script.Parent.Dialog.Visible = false
  228. talking = false
  229. game.ReplicatedStorage.Events.RespawnPlayer:FireServer()
  230. else
  231. do
  232. local t2 = "You already have a grimoire. I can reset your grimoire using my magic."
  233. do
  234. local l2 = string.len(t2)
  235. for i = 1, l2 do
  236. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t2, 1, i)
  237. wait()
  238. end
  239. MarketplaceService:PromptProductPurchase(p, 119865441)
  240. wait(3)
  241. script.Parent.Dialog.Visible = false
  242. talking = false
  243. do return end
  244. if script.Parent.Dialog.NPC.TextLabel.Text == "Yuno" then
  245. local t = "Thanks, good luck."
  246. local l = string.len(t)
  247. for i = 1, l do
  248. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  249. wait()
  250. end
  251. wait(3)
  252. local Quest = 1
  253. game.ReplicatedStorage.Events.StartQuest:FireServer(Quest)
  254. script.Parent.Dialog.Visible = false
  255. talking = false
  256. else
  257. do
  258. if script.Parent.Dialog.NPC.TextLabel.Text == "Asta" then
  259. local t = "HELLLL YEEEEAAAAAAAH!"
  260. local l = string.len(t)
  261. for i = 1, l do
  262. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  263. wait()
  264. end
  265. wait(3)
  266. local Quest = 3
  267. game.ReplicatedStorage.Events.StartQuest:FireServer(Quest)
  268. script.Parent.Dialog.Visible = false
  269. talking = false
  270. else
  271. do
  272. if script.Parent.Dialog.NPC.TextLabel.Text == "Yami" then
  273. if data.Lv.Value >= 15 then
  274. local t = "Welcome to the guild, noob."
  275. local l = string.len(t)
  276. for i = 1, l do
  277. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  278. wait()
  279. end
  280. wait(3)
  281. local Guild = "Black Bulls"
  282. game.ReplicatedStorage.Events.JoinGuild:FireServer(Guild)
  283. script.Parent.Dialog.Visible = false
  284. talking = false
  285. else
  286. do
  287. local t = "You\'re too weak, reach Lv. 15 first."
  288. do
  289. local l = string.len(t)
  290. for i = 1, l do
  291. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  292. wait()
  293. end
  294. wait(3)
  295. script.Parent.Dialog.Visible = false
  296. talking = false
  297. if script.Parent.Dialog.NPC.TextLabel.Text == "White Coat" then
  298. if data.Lv.Value >= 5 and data.Money.Value >= 300 then
  299. local t = "Thanks for the purchase."
  300. local l = string.len(t)
  301. for i = 1, l do
  302. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  303. wait()
  304. end
  305. wait(3)
  306. local Item = "Clothing1"
  307. game.ReplicatedStorage.Events.BuyItem:FireServer(Item)
  308. script.Parent.Dialog.Visible = false
  309. talking = false
  310. game.ReplicatedStorage.Events.RespawnPlayer:FireServer()
  311. else
  312. do
  313. local t = "Purchase failed. Please check your Level and Money."
  314. do
  315. local l = string.len(t)
  316. for i = 1, l do
  317. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  318. wait()
  319. end
  320. wait(3)
  321. script.Parent.Dialog.Visible = false
  322. talking = false
  323. if script.Parent.Dialog.NPC.TextLabel.Text == "Crimson Mage Armor" then
  324. if data.Lv.Value >= 15 and data.Money.Value >= 750 then
  325. local t = "Thanks for the purchase."
  326. local l = string.len(t)
  327. for i = 1, l do
  328. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  329. wait()
  330. end
  331. wait(3)
  332. local Item = "Clothing2"
  333. game.ReplicatedStorage.Events.BuyItem:FireServer(Item)
  334. script.Parent.Dialog.Visible = false
  335. talking = false
  336. game.ReplicatedStorage.Events.RespawnPlayer:FireServer()
  337. else
  338. do
  339. local t = "Purchase failed. Please check your Level and Money."
  340. do
  341. local l = string.len(t)
  342. for i = 1, l do
  343. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  344. wait()
  345. end
  346. wait(3)
  347. script.Parent.Dialog.Visible = false
  348. talking = false
  349. if script.Parent.Dialog.NPC.TextLabel.Text == "Black Bulls Uniform" then
  350. if data.Guild.Value == "Black Bulls" then
  351. local t = "Thanks for the purchase."
  352. local l = string.len(t)
  353. for i = 1, l do
  354. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  355. wait()
  356. end
  357. wait(3)
  358. local Item = "BlackBullsClothing"
  359. game.ReplicatedStorage.Events.BuyItem:FireServer(Item)
  360. script.Parent.Dialog.Visible = false
  361. talking = false
  362. game.ReplicatedStorage.Events.RespawnPlayer:FireServer()
  363. else
  364. do
  365. local t = "Purchase failed. You\'re not in the Black Bulls."
  366. local l = string.len(t)
  367. for i = 1, l do
  368. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  369. wait()
  370. end
  371. wait(3)
  372. script.Parent.Dialog.Visible = false
  373. talking = false
  374. end
  375. end
  376. end
  377. end
  378. end
  379. end
  380. end
  381. end
  382. end
  383. end
  384. end
  385. end
  386. end
  387. end
  388. end
  389. end
  390. end
  391. end
  392. end
  393. end
  394. end
  395. end
  396. end
  397. end
  398.  
  399. No = function()
  400. script.Parent.Dialog.Yes.Visible = false
  401. script.Parent.Dialog.No.Visible = false
  402. if script.Parent.Dialog.NPC.TextLabel.Text == "Grimoire Wizard" then
  403. local t = "Well, why did you talk to me in the first place then?"
  404. local l = string.len(t)
  405. for i = 1, l do
  406. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  407. wait()
  408. end
  409. wait(3)
  410. script.Parent.Dialog.Visible = false
  411. talking = false
  412. else
  413. do
  414. if script.Parent.Dialog.NPC.TextLabel.Text == "Yuno" then
  415. local t = "Wow, you\'re mean."
  416. local l = string.len(t)
  417. for i = 1, l do
  418. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  419. wait()
  420. end
  421. wait(3)
  422. script.Parent.Dialog.Visible = false
  423. talking = false
  424. else
  425. do
  426. if script.Parent.Dialog.NPC.TextLabel.Text == "Yami" then
  427. local t = "How dare you say no to me?!?"
  428. local l = string.len(t)
  429. for i = 1, l do
  430. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  431. wait()
  432. end
  433. wait(3)
  434. script.Parent.Dialog.Visible = false
  435. talking = false
  436. else
  437. do
  438. if script.Parent.Dialog.NPC.TextLabel.Text == "Asta" then
  439. local t = "OKAY, COME BACK AGAIN!"
  440. local l = string.len(t)
  441. for i = 1, l do
  442. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  443. wait()
  444. end
  445. wait(3)
  446. script.Parent.Dialog.Visible = false
  447. talking = false
  448. else
  449. do
  450. if script.Parent.Dialog.NPC.TextLabel.Text == "White Coat" then
  451. local t = "Come back again."
  452. local l = string.len(t)
  453. for i = 1, l do
  454. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  455. wait()
  456. end
  457. wait(3)
  458. script.Parent.Dialog.Visible = false
  459. talking = false
  460. else
  461. do
  462. if script.Parent.Dialog.NPC.TextLabel.Text == "Black Bulls Uniform" then
  463. local t = "Come back again."
  464. local l = string.len(t)
  465. for i = 1, l do
  466. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  467. wait()
  468. end
  469. wait(3)
  470. script.Parent.Dialog.Visible = false
  471. talking = false
  472. else
  473. do
  474. if script.Parent.Dialog.NPC.TextLabel.Text == "Crimson Mage Armor" then
  475. local t = "Come back again."
  476. local l = string.len(t)
  477. for i = 1, l do
  478. script.Parent.Dialog.Dialog.TextLabel.Text = string.sub(t, 1, i)
  479. wait()
  480. end
  481. wait(3)
  482. script.Parent.Dialog.Visible = false
  483. talking = false
  484. end
  485. end
  486. end
  487. end
  488. end
  489. end
  490. end
  491. end
  492. end
  493. end
  494. end
  495. end
  496. end
  497. end
  498.  
  499. Detect = function()
  500. local part = m.Target
  501. if part and part:FindFirstChild("Touch") and p.Character:FindFirstChild("HumanoidRootPart") then
  502. if part:FindFirstChild("Enabled") and part.Enabled.Value == false then
  503. return
  504. end
  505. local d = part.Position - p.Character.HumanoidRootPart.Position.magnitude
  506. local max = 25
  507. if d <= max then
  508. if part:FindFirstChild("Description") then
  509. script.Parent.Frame.Frame.TextLabel.Text = part.Description.Value
  510. else
  511. script.Parent.Frame.Frame.TextLabel.Text = "???"
  512. end
  513. if part:FindFirstChild("NPC") then
  514. interaction = "NPC"
  515. script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to talk"
  516. else
  517. if part:FindFirstChild("Item") then
  518. interaction = "Item"
  519. script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to pick up"
  520. else
  521. if part:FindFirstChild("Shop") then
  522. interaction = "Shop"
  523. script.Parent.Frame.Action.Frame.TextLabel.Text = "Click to buy"
  524. end
  525. end
  526. end
  527. script.Parent.Frame.Visible = true
  528. script.Parent.Frame.Position = UDim2.new(0, m.X, 0, m.Y)
  529. else
  530. script.Parent.Frame.Visible = false
  531. end
  532. else
  533. do
  534. script.Parent.Frame.Visible = false
  535. end
  536. end
  537. end
  538.  
  539. m.Move:connect(function()
  540. Detect()
  541. end)
  542. m.Button1Down:connect(function()
  543. Interact()
  544. end)
  545. script.Parent.Dialog.Yes.TextButton.MouseButton1Down:connect(function()
  546. Yes()
  547. end)
  548. script.Parent.Dialog.No.TextButton.MouseButton1Down:connect(function()
  549. No()
  550. end)
  551. while wait(1) do
  552. Detect()
  553. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement