Advertisement
Guest User

Roblox | Make yourself a ddlc character v.2

a guest
Jan 18th, 2018
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.74 KB | None | 0 0
  1. poem = nil
  2. resources = {
  3.     GlitchAudio = "rbxassetid://333430981";
  4.     BMusicAudio = "rbxassetid://1234948361";--edit this sound id for the background music
  5.     poem1 = [[
  6.         null
  7.         qxoo
  8.         oxqq
  9.         llun
  10.     ]];
  11.     poem2 = [[
  12. My sunshine,
  13. my only sunshine
  14.     ]];
  15.     poem3 = [[
  16.         null
  17.        
  18.         Example: To crypt D (of value 3), add the shift 3
  19.     ]];
  20. }
  21. firstperson = false
  22. lp = game.Players.LocalPlayer
  23. char = lp.Character
  24. glitchsound = Instance.new("Sound",char.Head)
  25. backgroundmusic = Instance.new("Sound",char.Head)
  26. glitchsound.SoundId = resources.GlitchAudio
  27. backgroundmusic.SoundId = resources.BMusicAudio
  28. backgroundmusic.Looped = true
  29. backgroundmusic:Play()
  30. function speak(text)
  31. model = Instance.new("Model",workspace)
  32. part = Instance.new("Part",model)
  33. part.Size = Vector3.new(1,1,1)
  34. part.CanCollide = false
  35. part.Anchored = true
  36. part.Position = char.Head.Position
  37. part.BrickColor = BrickColor.new("Lavender")
  38. part.Name = "Head"
  39. hum = Instance.new("Humanoid",model)
  40. clicktodelete = Instance.new("ClickDetector",part)
  41. clicktodelete.MouseClick:connect(function()
  42. model:Destroy()
  43. poem = nil
  44. end)
  45. for a=1, string.len(text) do
  46. wait(0.01)
  47. model.Name = string.sub(text,1,a)
  48. end
  49. while true do
  50. wait(0.01)
  51. part.Position = char.Head.Position
  52. end
  53. end
  54. lp.Chatted:connect(function(msg)
  55. chance = math.random(1,5)
  56. if chance == 2 then
  57. speak(string.reverse(msg))
  58. else
  59. speak(msg)
  60. end
  61. end)
  62. function glitchcam()
  63. glitchsound:Play()
  64. camera = workspace.CurrentCamera
  65. fov = camera.FieldOfView
  66. cce = Instance.new("ColorCorrectionEffect",game.Lighting)
  67. cce.Name = "glitcheffect"
  68. for i=1, 10 do
  69. wait(0.01)
  70. camera.FieldOfView = math.random(50,80)
  71. cce.Brightness = math.random()
  72. cce.Contrast = math.random()
  73. cce.Saturation = math.random()
  74. cce.TintColor = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255))
  75. end
  76. game:GetService("Debris"):AddItem(cce,1)
  77. cce:Destroy()
  78. camera.FieldOfView = fov
  79. get = game.Lighting:GetChildren()
  80. for i=1, #get do
  81. wait(0.01)
  82. if get[i].Name == "glitcheffect" then
  83. get[i]:Destroy()
  84. end
  85. end
  86. end
  87. function onKeyPress(inputObject, gameProcessedEvent)
  88.     if inputObject.KeyCode == Enum.KeyCode.Q then
  89.         glitchcam()
  90.     end
  91.     if inputObject.KeyCode == Enum.KeyCode.P then
  92.     if firstperson then
  93.     firstperson = false
  94.     else
  95.     firstperson = true
  96.     end
  97.     end
  98.     if inputObject.KeyCode == Enum.KeyCode.Z then
  99.     poem = resources["poem"..math.random(1,3)]
  100.     speak("I made a poem for you. Let me read it:\n"..poem)
  101.     end
  102. end
  103.  
  104. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
  105. while true do
  106. wait(0.01)
  107. if firstperson then
  108. workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
  109. workspace.CurrentCamera.CFrame = char.Head.CFrame
  110. else
  111. workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
  112. end
  113. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement