lunarcleint

MODCHART TUTORIAL

Nov 29th, 2021 (edited)
6,405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.17 KB | None | 0 0
  1. --MSG ME ON DISCORD OR @ ME IN MODDING COMMUNITY SERVER FOR HELP: @lunarcleint#8859 will code for your fnf mod if its cool:)
  2.  
  3. --SCRIPT FUNCTIONS(+ SPIN SHIT) [FUNCTIONS BY LUNARCLEINT(credit would be nice :)]: https://drive.google.com/file/d/1yKXShM214oCe2Dkg1JNvFsfh5eK0CJeG/view?usp=sharing
  4. --MADNESS VANDALIZTION MODCHART: https://www.youtube.com/watch?v=_vU9ygQ4kUo
  5. --TUTORIAL VIDEO: https://youtu.be/cE3RiizvGsg
  6. --LUA API WIKI: https://github.com/ShadowMario/FNF-PsychEngine/wiki/Lua-Script-API
  7.  
  8. local defaultNotePos = {};
  9. local spin = false;
  10. local arrowMoveX = 0;
  11. local arrowMoveY = 0;
  12.  
  13. function onSongStart()
  14.     for i = 0,7 do
  15.         x = getPropertyFromGroup('strumLineNotes', i, 'x')
  16.  
  17.         y = getPropertyFromGroup('strumLineNotes', i, 'y')
  18.  
  19.         table.insert(defaultNotePos, {x,y})
  20.     end
  21. end
  22.  
  23. function onUpdate(elapsed)
  24.  
  25.     songPos = getPropertyFromClass('Conductor', 'songPosition');
  26.  
  27.     currentBeat = (songPos / 1000) * (bpm / 60)
  28.  
  29.     if spin == true then
  30.         for i = 0,7 do
  31.             setPropertyFromGroup('strumLineNotes', i, 'x', defaultNotePos[i + 1][1] + arrowMoveX * math.sin((currentBeat + i*0.25) * math.pi))
  32.             setPropertyFromGroup('strumLineNotes', i, 'y', defaultNotePos[i + 1][2] + arrowMoveY * math.cos((currentBeat + i*0.25) * math.pi))
  33.         end
  34.     end
  35. end
  36.  
  37. function onStepHit()
  38.     stepdev = curStep % 16;
  39.     if stepdev == 0 then
  40.         section = curStep / 16;
  41.     end
  42. end
  43.  
  44. function coolresetStrums(time)
  45.     for i = 4,7 do
  46.         noteTweenX("movementX " .. i, i, defaultNotePos[i + 1][1], time, "linear")
  47.         noteTweenY("movementY " .. i, i, defaultNotePos[i + 1][2], time, "linear")
  48.         noteTweenAngle("movementAngle " .. i, i, 360, time, "linear")
  49.     end
  50. end
  51.  
  52. function randomNote()
  53.     for i = 4,7 do
  54.         setPropertyFromGroup('strumLineNotes', i, 'x',
  55.         defaultNotePos[i + 1][1] + math.floor(math.random(-150,150)))
  56.  
  57.         if downscroll == true then
  58.             ylowest = 50;
  59.             yhighest = -150;
  60.         else
  61.             ylowest = -150
  62.             yhighest = 150;
  63.         end
  64.  
  65.         setPropertyFromGroup('strumLineNotes', i, 'y',
  66.         defaultNotePos[i + 1][2] + math.floor(math.random(ylowest,yhighest)))
  67.     end
  68. end
  69.  
  70. function bumpArrows(time, amount, smallamount)
  71.     for i = 0,7 do
  72.         shit = 0;
  73.         if i % 4 == 0 then
  74.             shit = -amount
  75.         end
  76.         if i % 4 == 1 then
  77.             shit = -smallamount
  78.         end
  79.         if i % 4 == 2 then
  80.             shit = smallamount
  81.         end
  82.         if i % 4 == 3 then
  83.             shit = amount
  84.         end
  85.         setPropertyFromGroup('strumLineNotes', i, 'x', getPropertyFromGroup('strumLineNotes', i, 'x') + shit)
  86.         noteTweenX("movementXbump " .. i, i, getPropertyFromGroup('strumLineNotes', i, 'x') - shit, time, "linear")
  87.     end
  88. end
  89.  
  90. function fadeStrums(alpha,time,movebf,movedad)
  91.     if time <= 0 then
  92.         if movebf == true then
  93.             for i = 4,7 do
  94.                 setPropertyFromGroup('strumLineNotes', i, 'alpha', alpha)
  95.             end
  96.         end
  97.         if movedad == true then
  98.             for i = 0,3 do
  99.                 setPropertyFromGroup('strumLineNotes', i, 'alpha', alpha)
  100.             end
  101.         end
  102.     else
  103.         if movebf == true then
  104.             for i = 4,7 do
  105.                 noteTweenAlpha("movementAlpha " .. i, i, alpha, time, "linear")
  106.             end
  107.         end
  108.         if movedad == true then
  109.             for i = 0,3 do
  110.                 noteTweenAlpha("movementAlpha " .. i, i, alpha, time, "linear")
  111.             end
  112.         end
  113.     end
  114. end
  115.  
  116. function movebyStrumLine(x,y,time,movebf,movedad) --based on left arrow postion -lunar
  117.     if y == nil then
  118.         if downscroll == true then -- acounts for scrolling - lunar
  119.             y = 570
  120.         else
  121.             y = 50
  122.         end
  123.     end
  124.  
  125.     if time <= 0 then
  126.         if movebf == true then
  127.             for i = 4,7 do
  128.                 setPropertyFromGroup('strumLineNotes', i, 'x', x + ((i - 4) * 112))
  129.                 setPropertyFromGroup('strumLineNotes', i, 'y', y)
  130.             end
  131.         end
  132.         if movedad == true then
  133.             for i = 0,3 do
  134.                 setPropertyFromGroup('strumLineNotes', i, 'x', x + (i * 112))
  135.                 setPropertyFromGroup('strumLineNotes', i, 'y', y)
  136.             end
  137.         end
  138.     else
  139.         if movebf == true then
  140.             for i = 4,7 do
  141.                 noteTweenX("movementX " .. i, i, x + ((i - 4) * 112), time, "linear")
  142.                 noteTweenY("movementY " .. i, i, y, time, "linear")
  143.             end
  144.         end
  145.         if movedad == true then
  146.             for i = 0,3 do
  147.                 noteTweenX("movementX " .. i, i, x + (i * 112), time, "linear")
  148.                 noteTweenY("movementY " .. i, i, y, time, "linear")
  149.             end
  150.         end
  151.     end
  152. end
  153.  
  154. function resetStrums()
  155.     for i = 0,7 do
  156.         setPropertyFromGroup('strumLineNotes', i, 'x', defaultNotePos[i + 1][1])
  157.         setPropertyFromGroup('strumLineNotes', i, 'y', defaultNotePos[i + 1][2])
  158.         setPropertyFromGroup('strumLineNotes', i, 'alpha', 1)
  159.         setPropertyFromGroup('strumLineNotes', i, 'angle', 0)
  160.     end
  161. end
  162.  
  163. function moveAllStrums(x,y,time,movebf,movedad)
  164.     if time <= 0 then
  165.         if movebf == true then
  166.             for i = 4,7 do
  167.                 setPropertyFromGroup('strumLineNotes', i, 'x', x)
  168.                 setPropertyFromGroup('strumLineNotes', i, 'y', y)
  169.             end
  170.         end
  171.         if movedad == true then
  172.             for i = 0,3 do
  173.                 setPropertyFromGroup('strumLineNotes', i, 'x', x)
  174.                 setPropertyFromGroup('strumLineNotes', i, 'y', y)
  175.             end
  176.         end
  177.     else
  178.         if movebf == true then
  179.             for i = 4,7 do
  180.                 noteTweenX("movementX " .. i, i, x, time, "linear")
  181.                 noteTweenY("movementY " .. i, i, y, time, "linear")
  182.             end
  183.         end
  184.         if movedad == true then
  185.             for i = 0,3 do
  186.                 noteTweenX("movementX " .. i, i, x, time, "linear")
  187.                 noteTweenY("movementY " .. i, i, y, time, "linear")
  188.             end
  189.         end
  190.     end
  191. end
  192.  
  193.  
Add Comment
Please, Sign In to add comment