Advertisement
InTesting

Sans Command (/sans <keyword>)

Jun 13th, 2019
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.78 KB | None | 0 0
  1. -- New command is /sans <kw> instead of /s <kw> to avoid vsb stuff
  2. print'Source : https://pastebin.com/bw1JwFXU'
  3. print'Yeah basically '
  4. print'/sans <keyword: player name>'
  5. print' Basically wont let them play until sans gets tired. if they die, they restart.'
  6.  
  7. local function oofsans(owner1)
  8.     if workspace:FindFirstChild'∞box'then
  9.         workspace:FindFirstChild'∞box':Destroy()
  10.     end
  11.     script.Parent = owner1
  12.     local repstor = game:GetService("ReplicatedStorage")
  13.     local players = game:GetService("Players")
  14.    
  15.     local osans = repstor:FindFirstChild('∞sans')
  16.    
  17.    
  18.     local function MakeSound(par,id,vol,looped1)
  19.         local s = Instance.new("Sound",par)
  20.         s.SoundId = id
  21.         s.Volume = vol
  22.         s.Looped = looped1
  23.         s:Play()
  24.         if looped1==false then
  25.             s.Ended:connect(function()
  26.                 s:Destroy()
  27.             end)
  28.         end
  29.     end
  30.     local function weldif(p1,p2)
  31.         local w = Instance.new("WeldConstraint",p1)
  32.         w.Part0 = p1
  33.         w.Part1 = p2
  34.     end
  35.     local function GetPlayerFromKeyword(kw)
  36.         for _,v in pairs(game:GetService'Players':GetPlayers())do
  37.             local vname = v.Name
  38.             if string.find(
  39.                 vname:reverse():lower(),
  40.                 kw:reverse():lower(),
  41.                 vname:len()-kw:len()
  42.             )~=nil then
  43.                 return v
  44.             end
  45.         end
  46.     end
  47.     local function Box(player)
  48.         local pchar = player.Character
  49.         if pchar then
  50.             local phead = pchar:FindFirstChild'Head'
  51.             if phead then
  52.                 phead.CFrame = phead.CFrame + Vector3.new(0,17.5,0)
  53.                 local mod = Instance.new("Model",workspace)
  54.                 mod.Name = '∞box'
  55.                
  56.                 local p1 = Instance.new("Part",mod)
  57.                 p1.Position = phead.Position + Vector3.new(0,-15,0)
  58.                 p1.Size = Vector3.new(30, 2, 30)
  59.                
  60.                 p1.Name = '∞base'
  61.                
  62.                 local sans = Instance.new("Part",mod)
  63.                 sans.Position = phead.Position + Vector3.new(0,-12.5,-14)
  64.                 sans.Size = Vector3.new(4, 4, 1)
  65.                
  66.                 local d = Instance.new("Decal",sans)
  67.                 d.Texture = 'rbxassetid://1105996889'
  68.                 d.Face = Enum.NormalId.Back
  69.                
  70.                 local d2 = Instance.new("Decal",sans)
  71.                 d2.Texture = 'rbxassetid://1105996889'
  72.                 d2.Face = Enum.NormalId.Front
  73.                
  74.                 local p2 = Instance.new("Part",mod)
  75.                 p2.Position = phead.Position + Vector3.new(0,15,0)
  76.                 p2.Size = Vector3.new(30, 2, 30)
  77.                
  78.                 local p3 = Instance.new("Part",mod)
  79.                 p3.Position = phead.Position + Vector3.new(-15,0,0)
  80.                 p3.Size = Vector3.new(2, 30, 30)
  81.                
  82.                 local p4 = Instance.new("Part",mod)
  83.                 p4.Position = phead.Position + Vector3.new(15,0,0)
  84.                 p4.Size = Vector3.new(2, 30, 30)
  85.                
  86.                 local p5 = Instance.new("Part",mod)
  87.                 p5.Position = phead.Position + Vector3.new(0,0,15)
  88.                 p5.Size = Vector3.new(30, 30, 2)
  89.                
  90.                 local p6 = Instance.new("Part",mod)
  91.                 p6.Position = phead.Position + Vector3.new(0,0,-15)
  92.                 p6.Size = Vector3.new(30, 30, 2)
  93.                
  94.                 for _,v in pairs(mod:GetChildren())do
  95.                     v.Anchored = true
  96.                     v.Massless = true
  97.                     v.Material = Enum.Material.Grass
  98.                     v.BrickColor = BrickColor.new('Sea green')
  99.                     if v~=p1  then
  100.                         v.Transparency = 1
  101.                     end
  102.                 end
  103.             end
  104.            
  105.         end
  106.     end
  107.     local function MakeGrounds(targetplayer)
  108.         if workspace:FindFirstChild('∞box')==nil then
  109.             local tpl = targetplayer
  110.             if tpl~=nil then
  111.                
  112.                 local tch = tpl.Character
  113.                
  114.            
  115.                 local tsg = Instance.new("ScreenGui",tpl:FindFirstChildWhichIsA'PlayerGui')
  116.                 tsg.ResetOnSpawn = false
  117.                 tsg.Name = '∞ssgui'
  118.            
  119.                 local f1 = Instance.new("Frame",tsg)
  120.                 f1.Position = UDim2.new(1,0,0,0)
  121.                 f1.Size = UDim2.new(1,0,1,0)
  122.                 f1.BackgroundColor3 = Color3.new(0,0,0)
  123.                
  124.                
  125.                
  126.                 f1:TweenPosition(UDim2.new(0,0,0,0))
  127.                 wait(1)
  128.                 MakeSound(tch,'rbxassetid://3263122823',5,false)
  129.                 Box(tpl)
  130.                 wait(1)
  131.                 if tpl:FindFirstChild('∞ssgui',true) then
  132.                     if tpl:FindFirstChild('∞ssgui',true).Frame then
  133.                         tpl:FindFirstChild('∞ssgui',true).Frame:TweenPosition(UDim2.new(-1,0,0,0))
  134.                     end
  135.                 end
  136.                 wait(1)
  137.                 if tpl:FindFirstChild('∞ssgui',true) then
  138.                     tpl:FindFirstChild('∞ssgui',true):Destroy()
  139.                 end
  140.                 MakeSound(workspace:FindFirstChild('∞box'),'rbxassetid://3209932218',2.5,true)
  141.        
  142.                 wait(1.5)
  143.                 local died = false
  144.                 local function ballhit()
  145.                     local base = workspace:FindFirstChild('∞base',true)
  146.                     if base and tch:FindFirstChild'Head'and died==false then
  147.                         local par1 = Instance.new("Part",workspace)
  148.                         par1.Shape = Enum.PartType.Ball
  149.                         par1.Size = Vector3.new(3,3,3)
  150.                         par1.Position = tch:FindFirstChild'Head'.Position + Vector3.new(0,20,0)
  151.                         par1.BrickColor = BrickColor.new("Really red")
  152.                         par1.Material = Enum.Material.Granite
  153.                         par1.CanCollide = false
  154.                                
  155.                         par1.Touched:Connect(function(hit)
  156.                             local osans = repstor:FindFirstChild('∞sans')
  157.                             if osans and died==false then
  158.                                 if hit.Parent:FindFirstChildWhichIsA'Humanoid' then
  159.                                     if hit.Parent.Name==osans.Value then
  160.                                         hit.Parent:FindFirstChildWhichIsA'Humanoid'.Health = 0
  161.                                         died  = true
  162.                                     end
  163.                                 elseif hit.Parent:FindFirstChild'Head'then
  164.                                     if hit.Parent.Name==osans.Value then
  165.                                         hit.Parent:FindFirstChild'Head':Destroy()
  166.                                         died  = true
  167.                                     end
  168.                                 end
  169.                             end
  170.                         end)
  171.                         wait(.5)
  172.                     end
  173.                 end
  174.                 local function misslemiddle()
  175.                     local base = workspace:FindFirstChild('∞base',true)
  176.                     if base and tch:FindFirstChild'Head'and died==false then
  177.                         local thead = tch:FindFirstChild'Head'
  178.                         local part1 = Instance.new("Part",workspace)
  179.                         part1.Size = Vector3.new(2,2,2)
  180.                         part1.BrickColor = BrickColor.new("Really red")
  181.                         part1.Material = Enum.Material.Granite
  182.                         part1.CanCollide = false
  183.                         part1.Anchored = true
  184.                         part1.CFrame = thead.CFrame * CFrame.new(0,0,30)
  185.                        
  186.                         part1.Touched:Connect(function(hit)
  187.                             local osans = repstor:FindFirstChild('∞sans')
  188.                             if osans and died==false then
  189.                                
  190.                                 if hit.Parent:FindFirstChildWhichIsA'Humanoid' then
  191.                                     hit.Parent:FindFirstChildWhichIsA'Humanoid'.Health = 0
  192.                                     if hit.Parent.Name==osans.Value then
  193.                                        
  194.                                         died  = true
  195.                                     end
  196.                                 elseif hit.Parent:FindFirstChild'Head'then
  197.                                     hit.Parent:FindFirstChild'Head':Destroy()
  198.                                     if hit.Parent.Name==osans.Value then
  199.                                        
  200.                                         died  = true
  201.                                     end
  202.                                 end
  203.                             end
  204.                         end)
  205.                         wait()
  206.                         for i=1,30 do
  207.                             part1.CFrame = part1.CFrame * CFrame.new(0,0,-2)
  208.                             wait()
  209.                         end
  210.                         part1.Anchored = false
  211.                     end
  212.                 end
  213.                 local function floorobj1()
  214.                     local base = workspace:FindFirstChild('∞base',true)
  215.                     if base and tch:FindFirstChild'Head'and died==false then
  216.                         local thead = tch:FindFirstChild'Head'
  217.                         local part1 = Instance.new("Part",workspace)
  218.                         part1.Size = Vector3.new(40,1,1)
  219.                         part1.BrickColor = BrickColor.new("Really red")
  220.                         part1.Material = Enum.Material.Granite
  221.                         part1.CanCollide = false
  222.                         part1.Anchored = true
  223.                         part1.CFrame = thead.CFrame * CFrame.new(0,-3,30)
  224.                        
  225.                         part1.Touched:Connect(function(hit)
  226.                             local osans = repstor:FindFirstChild('∞sans')
  227.                             if osans and died==false then
  228.                                
  229.                                 if hit.Parent:FindFirstChildWhichIsA'Humanoid' then
  230.                                     hit.Parent:FindFirstChildWhichIsA'Humanoid'.Health = 0
  231.                                     if hit.Parent.Name==osans.Value then
  232.                                        
  233.                                         died  = true
  234.                                     end
  235.                                 elseif hit.Parent:FindFirstChild'Head'then
  236.                                     hit.Parent:FindFirstChild'Head':Destroy()
  237.                                     if hit.Parent.Name==osans.Value then
  238.                                        
  239.                                         died  = true
  240.                                     end
  241.                                 end
  242.                             end
  243.                         end)
  244.                         wait()
  245.                         for i=1,30 do
  246.                             part1.CFrame = part1.CFrame * CFrame.new(0,0,-2)
  247.                             wait()
  248.                         end
  249.                         part1.Anchored = false
  250.                     end
  251.                 end
  252.                 local function barvert()
  253.                     local base = workspace:FindFirstChild('∞base',true)
  254.                     if base and tch:FindFirstChild'Head'and died==false then
  255.                         local thead = tch:FindFirstChild'Head'
  256.                         local part1 = Instance.new("Part",workspace)
  257.                         part1.Size = Vector3.new(1,10,1)
  258.                         part1.BrickColor = BrickColor.new("Really red")
  259.                         part1.Material = Enum.Material.Granite
  260.                         part1.CanCollide = false
  261.                         part1.Anchored = true
  262.                         part1.CFrame = thead.CFrame * CFrame.new(0,-3,30)
  263.                        
  264.                         part1.Touched:Connect(function(hit)
  265.                             local osans = repstor:FindFirstChild('∞sans')
  266.                             if osans and died==false then
  267.                                
  268.                                 if hit.Parent:FindFirstChildWhichIsA'Humanoid' then
  269.                                    
  270.                                     if hit.Parent.Name==osans.Value then
  271.                                         hit.Parent:FindFirstChildWhichIsA'Humanoid'.Health = 0
  272.                                         died  = true
  273.                                     end
  274.                                 elseif hit.Parent:FindFirstChild'Head'then
  275.                                    
  276.                                     if hit.Parent.Name==osans.Value then
  277.                                         hit.Parent:FindFirstChild'Head':Destroy()
  278.                                         died  = true
  279.                                     end
  280.                                 end
  281.                             end
  282.                         end)
  283.                         wait()
  284.                         for i=1,30 do
  285.                             part1.CFrame = part1.CFrame * CFrame.new(0,0,-2)
  286.                             wait()
  287.                         end
  288.                         part1.Anchored = false
  289.                     end
  290.                 end
  291.                
  292.                 wait()
  293.                 local endnum = 10
  294.                 for i=1,endnum do
  295.                     local base = workspace:FindFirstChild('∞base',true)
  296.                     local rannum = math.random(1,4)
  297.                     if rannum==1 then
  298.                         for i=1,5 do
  299.                             ballhit()
  300.                             wait(.25)
  301.                         end
  302.                     elseif rannum==2 then
  303.                         for i=1,5 do
  304.                             misslemiddle()
  305.                             wait(.25)
  306.                         end
  307.                     elseif rannum==3 then
  308.                         for i=1,5 do
  309.                             floorobj1()
  310.                             wait(.25)
  311.                         end
  312.                     elseif rannum==4 then
  313.                         for i=1,5 do
  314.                             barvert()
  315.                             wait(.25)
  316.                         end
  317.                     end
  318.                     if base==nil or tch:FindFirstChild'Head'==nil then
  319.                         break
  320.                     end
  321.                    
  322.                     if i==endnum and died==false and tpl~=nil then
  323.                         local osans = repstor:FindFirstChild('∞sans')
  324.                         if osans then
  325.                             osans:Destroy()
  326.                         end
  327.                         local box = workspace:FindFirstChild('∞box')
  328.                         if box then
  329.                             box:Destroy()
  330.                         end
  331.                     end
  332.                     wait(2)
  333.                    
  334.                 end
  335.             end
  336.         end
  337.     end
  338.    
  339.     if osans then
  340.         MakeGrounds(GetPlayerFromKeyword(osans.Value))
  341.     end
  342.     workspace.DescendantAdded:Connect(function(de)
  343.         local osans = repstor:FindFirstChild('∞sans')
  344.         if de:IsA'Tool'and osans and de.Name=='Fly'then
  345.             if osans.Value==de.Parent.Name then
  346.                 de:Destroy()
  347.             end
  348.         end
  349.     end)
  350.     owner1.Chatted:Connect(function(msg)
  351.         if msg:sub(1,6):lower()=='/sans 'then
  352.             local tarpl = GetPlayerFromKeyword(msg:sub(7))
  353.             if tarpl then
  354.                 local strval = repstor:FindFirstChild('∞sans')
  355.                 local scheck1 = false
  356.                 if strval then
  357.                    
  358.                     strval.Value = tarpl.Name
  359.                     scheck1 = true
  360.                    
  361.                 else
  362.                     strval = Instance.new("StringValue",repstor)
  363.                     strval.Value = tarpl.Name
  364.                     strval.Name = '∞sans'
  365.                     scheck1 = true
  366.                 end
  367.                 if scheck1 then
  368.                     GetPlayerFromKeyword(strval.Value):LoadCharacter()
  369.                     MakeGrounds(GetPlayerFromKeyword(strval.Value))
  370.                 end            
  371.             end
  372.         end
  373.     end)
  374.     for _,v in pairs(players:players())do
  375.         v.CharacterAdded:Connect(function(ch)
  376.             wait()
  377.             local osans = repstor:FindFirstChild('∞sans')
  378.             if osans~=nil then
  379.                 if tostring(v.Name )==tostring( osans.Value) then
  380.                     if workspace:FindFirstChild'∞box'then
  381.                         workspace:FindFirstChild'∞box':Destroy()
  382.                     end
  383.                     wait()
  384.                 end
  385.             end
  386.         end)
  387.     end
  388.     players.PlayerAdded:Connect(function(pr1)
  389.         pr1.CharacterAdded:Connect(function(ch)
  390.             wait()
  391.             local osans = repstor:FindFirstChild('∞sans')
  392.             if osans~=nil then
  393.                 if tostring( pr1.Name )==tostring( osans.Value) then
  394.                     if workspace:FindFirstChild'∞box'then
  395.                         workspace:FindFirstChild'∞box':Destroy()
  396.                     end                
  397.                 end
  398.             end
  399.         end)
  400.     end)
  401.     workspace.ChildRemoved:Connect(function(de)
  402.         local osans = repstor:FindFirstChild('∞sans')
  403.         if de.Name=='∞box' and osans then
  404.             wait(1)
  405.             MakeGrounds(GetPlayerFromKeyword(osans.Value))
  406.         end
  407.     end)
  408.  
  409. end
  410. wait(1)
  411. oofsans(owner)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement