Savekiki

Quest System 2

May 3rd, 2022
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. game:GetService("ReplicatedStorage"):WaitForChild("GetQuest").OnClientEvent:Connect(function(QuestName, Target, Max, Money, LvRequest ,Title)
  2.  
  3. --/ Lcoal
  4.  
  5. local Player = game:GetService("Players").LocalPlayer
  6. local Ui = script.Parent
  7. local TalkUi = Ui:WaitForChild("Bk")
  8. --/ Anchored
  9. Player.Character:WaitForChild("HumanoidRootPart").Anchored = true
  10.  
  11. --/ Talk
  12. TalkUi.Yes.Visible = false
  13. TalkUi.No.Visible = false
  14. TalkUi.Npc.Text = QuestName
  15. TalkUi.Lv.Text = "LevelRequest : "..LvRequest
  16.  
  17. --/ Open UI
  18. TalkUi.Visible = true
  19.  
  20. for i = 1, #Title, 1 do wait()
  21. TalkUi.Title.Text = string.sub(Title, 1, i)
  22. end
  23.  
  24. TalkUi.Yes.Visible = true
  25. TalkUi.No.Visible = true
  26.  
  27. TalkUi.Yes.MouseButton1Click:Connect(function()
  28. Player.Character:WaitForChild("HumanoidRootPart").Anchored = false
  29. game:GetService("ReplicatedStorage"):WaitForChild("GetQuest"):FireServer(QuestName, Target, Max, Money)
  30. TalkUi.Visible = false
  31. end)
  32. TalkUi.No.MouseButton1Click:Connect(function()
  33. Player.Character:WaitForChild("HumanoidRootPart").Anchored = false
  34. TalkUi.Visible = false
  35. end)
  36.  
  37. end)
  38.  
  39. spawn(function()
  40. while wait(.25) do
  41. local Player = game:GetService("Players").LocalPlayer
  42. local QuestFodler = Player:WaitForChild("Quest")
  43.  
  44. if QuestFodler:WaitForChild("QuestName").Value ~= "" then
  45. script.Parent.Show.Visible = true
  46.  
  47. script.Parent.Show.QuestName.Text = QuestFodler:WaitForChild("QuestName").Value
  48. script.Parent.Show.Reward.Text = "Reward : Money "..QuestFodler:WaitForChild("Money").Value
  49. script.Parent.Show.CountQuest.Text = "Defeat :"..QuestFodler:WaitForChild("Target").Value.." | "..QuestFodler:WaitForChild("Now").Value.."/"..QuestFodler:WaitForChild("Max").Value
  50.  
  51. else
  52. script.Parent.Show.Visible = false
  53. end
  54. end
  55. end)
Advertisement
Add Comment
Please, Sign In to add comment