Advertisement
Filipono120

[ROBLOX] Minecraft Bedrock Comands

Nov 12th, 2020 (edited)
2,074
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.43 KB | None | 0 0
  1. --This isn't tested and approved by mojang
  2.  
  3. --[[
  4.     Commands List: =======================================================================================
  5.     | /tp <target> <x: integer> <subX: integer> <y: integer> <subY: integer> <z: integer> <subZ: integer>
  6.     | /testfor <target>
  7.     | /playsound <soundid: integer> <target> <volume: float> <pitch: float>
  8.     | /stopsound <target>
  9.     | /effect <target> <effectType: string> <seconds: float> <amplifier: float>
  10.     | /clr <target>
  11.     | /kill <target>
  12.     | /gamerule <gamerule: string> <gameruleBoolean: boolean>
  13.     ======================================================================================================
  14.     More commands coming soon!
  15.     {\_/}
  16.     ( o-o) ===================================================================================================
  17.      ><3<  == Join builders club fans: https://web.roblox.com/groups/4741701/NBC-Builders-Club-Fans#!/about ==
  18.            ===================================================================================================
  19. ]]
  20.  
  21. --Converted with ttyyuu12345's model to script plugin v4
  22. function sandbox(var,func)
  23.     local env = getfenv(func)
  24.     local newenv = setmetatable({},{
  25.         __index = function(self,k)
  26.             if k=="script" then
  27.                 return var
  28.             else
  29.                 return env[k]
  30.             end
  31.         end,
  32.     })
  33.     setfenv(func,newenv)
  34.     return func
  35. end
  36. cors = {}
  37. mas = Instance.new("Model",game:GetService("Lighting"))
  38. LocalScript0 = Instance.new("LocalScript")
  39. LocalScript0.Name = "MinecraftBedrockCommands2"
  40. LocalScript0.Parent = mas
  41. table.insert(cors,sandbox(LocalScript0,function()
  42. --MineBedrockCommands
  43. --Made by filipaogamer345!
  44.  
  45. wait(1 / 60)
  46.  
  47. --Variables
  48. local player = game.Players.LocalPlayer
  49. local character = player.Character
  50. local CommandArgum = "/" --This command argument it's like minecraft java/bedrock
  51. local players = {}
  52.  
  53. --System Variables
  54. local Sound
  55.  
  56. --Functions
  57. local function FindPlayer(player)
  58.     for _, v in pairs(game.Players:GetPlayers()) do
  59.         if string.lower(v.Name) == player then
  60.             return v
  61.         end
  62.     end
  63. end
  64. local function UpdatePlayers()
  65.     for _, v in pairs(game.Players:GetPlayers()) do
  66.         if players[1] then
  67.             table.remove(players, #game.Players:GetChildren())
  68.         end
  69.     end
  70.     for _, v in pairs(game.Players:GetPlayers()) do
  71.         table.insert(players, v)
  72.     end
  73. end
  74.  
  75. --Tables
  76. local Commands = {
  77.     ["tp"] = function(args)
  78.         for i, argums in pairs(args) do
  79.             print(argums)
  80.         end
  81.         local Entity = args[1]
  82.         local X = args[2]
  83.         local SX = args[3]
  84.         local Y = args[4]
  85.         local SY = args[5]
  86.         local Z = args[6]
  87.         local SZ = args[7]
  88.  
  89.         if Entity and X and Y and Z and SX and SY and SZ then
  90.             local ent
  91.             local char
  92.             if Entity == "@s" then
  93.                 ent = player
  94.                 char = ent.Character
  95.             elseif Entity == "@p" then
  96.                 ent = player
  97.                 char = ent.Character
  98.             elseif Entity == "@a" then
  99.                 for _, v in pairs(game.Players:GetPlayers()) do
  100.                     ent = v
  101.                     char = ent.Character
  102.                 end
  103.             elseif Entity == "@r" then
  104.                 UpdatePlayers()
  105.                 local randomPlr = players[math.random(1, #players)]
  106.                 ent = randomPlr
  107.                 char = ent.Character
  108.             else
  109.                 ent = FindPlayer(Entity)
  110.                 char = Entity.Character
  111.             end
  112.             --X
  113.             if X == "~" then
  114.                 char:SetPrimaryPartCFrame(character:GetPrimaryPartCFrame())
  115.             else
  116.                 char:MoveTo(Vector3.new(X, Y, Z))
  117.             end
  118.  
  119.             --Y
  120.             if Y == "~" then
  121.                 char:SetPrimaryPartCFrame(character:GetPrimaryPartCFrame())
  122.             else
  123.                 char:MoveTo(Vector3.new(X, Y, Z))
  124.             end
  125.  
  126.             --Z
  127.             if Z == "~" then
  128.                 char:SetPrimaryPartCFrame(character:GetPrimaryPartCFrame())
  129.             else
  130.                 char:MoveTo(Vector3.new(X, Y, Z))
  131.             end
  132.  
  133.             --SX, SY, SZ
  134.             char:SetPrimaryPartCFrame(character:GetPrimaryPartCFrame() * CFrame.new(SX, SY, SZ))
  135.         else
  136.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  137.                 Text = "<Entity> <X> <SubX> <Y> <SubY> <Z> <SubZ>";
  138.                 Font = Enum.Font.SourceSansBold;
  139.                 Color = Color3.new(255, 0.2, 0);   
  140.             })
  141.         end
  142.     end,
  143.     ["gamerule"] = function(args)
  144.         for i, argums in pairs(args) do
  145.             print(argums)
  146.         end
  147.         local GameRuleValue = args[1]
  148.         local BoolValue = args[2]
  149.         local Gamerule1
  150.         if GameRuleValue == "falldamage" then
  151.             if BoolValue == "true" then
  152.                 Gamerule1 = coroutine.resume(coroutine.create(function()
  153.                     local fallTime = 0
  154.                     while BoolValue == "true" do
  155.                         local x = wait()
  156.                         if character.HumanoidRootPart.Velocity.Y <= -18 then
  157.                             fallTime = fallTime + x
  158.                         end
  159.                         if character.HumanoidRootPart.Velocity.Y > -18 then
  160.                             if fallTime >= 0.25 then
  161.                                 character.Humanoid:TakeDamage(fallTime * 50)
  162.                             end
  163.                             fallTime = 0
  164.                         end
  165.                         wait()
  166.                     end
  167.                 end))
  168.             elseif BoolValue == "false" then
  169.                 if Gamerule1 ~= nil then
  170.                     Gamerule1:Disconnect()
  171.                 end
  172.             end
  173.         else
  174.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  175.                 Text = "<GameruleName> <BoolValue>";
  176.                 Font = Enum.Font.SourceSansBold;
  177.                 Color = Color3.new(255, 0.2, 0);   
  178.             })
  179.         end
  180.     end,
  181.     ["clr"] = function(args)
  182.         for i, argums in pairs(args) do
  183.             print(argums)
  184.         end
  185.         local Entity = args[1]
  186.         if Entity then
  187.             local ent
  188.             local char
  189.             if Entity == "@s" then
  190.                 ent = player
  191.                 char = ent.Character
  192.             elseif Entity == "@p" then
  193.                 ent = player
  194.                 char = ent.Character
  195.             elseif Entity == "@a" then
  196.                 for _, v in pairs(game.Players:GetPlayers()) do
  197.                     ent = v
  198.                     char = ent.Character
  199.                 end
  200.             elseif Entity == "@r" then
  201.                 UpdatePlayers()
  202.                 local randomPlr = players[math.random(1, #players)]
  203.                 ent = randomPlr
  204.                 char = ent.Character
  205.             else
  206.                 ent = FindPlayer(Entity)
  207.                 char = Entity.Character
  208.             end
  209.             local backpack = ent.Backpack
  210.             backpack:ClearAllChildren()
  211.         else
  212.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  213.                 Text = "<EntityType>";
  214.                 Font = Enum.Font.SourceSansBold;
  215.                 Color = Color3.new(255, 0.2, 0);   
  216.             })
  217.         end
  218.     end,
  219.     ["kill"] = function(args)
  220.         for i, argums in pairs(args) do
  221.             print(argums)
  222.         end
  223.         local Entity = args[1]
  224.         if Entity then
  225.             local ent
  226.             local char
  227.             if Entity == "@s" then
  228.                 ent = player
  229.                 char = ent.Character
  230.             elseif Entity == "@p" then
  231.                 ent = player
  232.                 char = ent.Character
  233.             elseif Entity == "@a" then
  234.                 for _, v in pairs(game.Players:GetPlayers()) do
  235.                     ent = v
  236.                     char = ent.Character
  237.                 end
  238.             elseif Entity == "@r" then
  239.                 UpdatePlayers()
  240.                 local randomPlr = players[math.random(1, #players)]
  241.                 ent = randomPlr
  242.                 char = ent.Character
  243.             else
  244.                 ent = FindPlayer(Entity)
  245.                 char = Entity.Character
  246.             end
  247.             char.Head:Destroy()
  248.         else
  249.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  250.                 Text = "<EntityType>";
  251.                 Font = Enum.Font.SourceSansBold;
  252.                 Color = Color3.new(255, 0.2, 0);   
  253.             })
  254.         end
  255.     end,
  256.     ["testfor"] = function(args)
  257.         for i, argums in pairs(args) do
  258.             print(argums)
  259.         end
  260.         local Entity = args[1]
  261.         if Entity then
  262.             local ent
  263.             local char
  264.             if Entity == "@s" then
  265.                 ent = player
  266.                 char = ent.Character
  267.             elseif Entity == "@p" then
  268.                 ent = player
  269.                 char = ent.Character
  270.             elseif Entity == "@a" then
  271.                 for _, v in pairs(game.Players:GetPlayers()) do
  272.                     ent = v
  273.                     char = ent.Character
  274.                 end
  275.             elseif Entity == "@r" then
  276.                 UpdatePlayers()
  277.                 local randomPlr = players[math.random(1, #players)]
  278.                 ent = randomPlr
  279.                 char = ent.Character
  280.             else
  281.                 ent = FindPlayer(Entity)
  282.                 char = Entity.Character
  283.             end
  284.             if ent then
  285.                 game.StarterGui:SetCore("ChatMakeSystemMessage", {
  286.                     Text = ent.Name.." founded";
  287.                     Font = Enum.Font.SourceSansBold;
  288.                     Color = Color3.new(255, 255, 255);
  289.                 })
  290.             else
  291.                 game.StarterGui:SetCore("ChatMakeSystemMessage", {
  292.                     Text = ent.Name.." not found.";
  293.                     Font = Enum.Font.SourceSansBold;
  294.                     Color = Color3.new(255, 0.2, 0);
  295.                 })
  296.             end
  297.         else
  298.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  299.                 Text = "<EntityType>";
  300.                 Font = Enum.Font.SourceSansBold;
  301.                 Color = Color3.new(255, 0.2, 0);   
  302.             })
  303.         end
  304.     end,
  305.     ["effect"] = function(args)
  306.         for i, argums in pairs(args) do
  307.             print(argums)
  308.         end
  309.         local Entity = args[1]
  310.         local EffectType = args[2]
  311.         local Seconds = args[3]
  312.         local Amplifier = args[4]
  313.         if Entity then
  314.             local ent
  315.             local char
  316.             if Entity == "@s" then
  317.                 ent = player
  318.                 char = ent.Character
  319.             elseif Entity == "@p" then
  320.                 ent = player
  321.                 char = ent.Character
  322.             elseif Entity == "@a" then
  323.                 for _, v in pairs(game.Players:GetPlayers()) do
  324.                     ent = v
  325.                     char = ent.Character
  326.                 end
  327.             elseif Entity == "@r" then
  328.                 UpdatePlayers()
  329.                 local randomPlr = players[math.random(1, #players)]
  330.                 ent = randomPlr
  331.                 char = ent.Character
  332.             else
  333.                 ent = FindPlayer(Entity)
  334.                 char = Entity.Character
  335.             end
  336.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  337.                 Text = "Effect "..EffectType.." applied with "..Seconds.." seconds and "..Amplifier.." of amplifier";
  338.                 Font = Enum.Font.SourceSansBold;
  339.                 Color = Color3.new(255, 255, 255); 
  340.             })
  341.             if EffectType == "speed" and Seconds and Amplifier then
  342.                 local Humanoid = char.Humanoid
  343.                 Humanoid.WalkSpeed = Amplifier + 20
  344.                 while wait(1) do
  345.                     Seconds = Seconds - 1
  346.                     if Seconds == 0 then
  347.                         Humanoid.WalkSpeed = 16
  348.                         break
  349.                     end
  350.                 end
  351.             elseif EffectType == "jump_boost" and Seconds and Amplifier then
  352.                 local Humanoid = char.Humanoid
  353.                 Humanoid.JumpPower = Humanoid.JumpPower + Amplifier * 5
  354.                 while wait(1) do
  355.                     Seconds = Seconds - 1
  356.                     if Seconds == 0 then
  357.                         Humanoid.JumpPower = 50
  358.                         break
  359.                     end
  360.                 end
  361.             elseif EffectType == "health_boost" and Seconds and Amplifier then
  362.                 local Humanoid = char.Humanoid
  363.                 while wait(1) do
  364.                     Humanoid.Health = Humanoid.Health + Amplifier
  365.                     Seconds = Seconds - 1
  366.                     if Seconds == 0 then
  367.                         break
  368.                     end
  369.                 end
  370.             end
  371.         else
  372.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  373.                 Text = "<EntityType> <EffectType> <Seconds> <Amplifier>";
  374.                 Font = Enum.Font.SourceSansBold;
  375.                 Color = Color3.new(255, 0.2, 0);   
  376.             })
  377.         end
  378.     end,
  379.     ["playsound"] = function(args)
  380.         for i, argums in pairs(args) do
  381.             print(argums)
  382.         end
  383.         local SoundSource = args[1]
  384.         local Entity = args[2]
  385.         local Volume = args[3]
  386.         local Pitch = args[4]
  387.         if SoundSource and Entity and Volume and Pitch then
  388.             local ent
  389.             local char
  390.             if Entity == "@s" then
  391.                 ent = player
  392.                 char = ent.Character
  393.             elseif Entity == "@p" then
  394.                 ent = player
  395.                 char = ent.Character
  396.             elseif Entity == "@a" then
  397.                 for _, v in pairs(game.Players:GetPlayers()) do
  398.                     ent = v
  399.                     char = ent.Character
  400.                 end
  401.             elseif Entity == "@r" then
  402.                 UpdatePlayers()
  403.                 local randomPlr = players[math.random(1, #players)]
  404.                 ent = randomPlr
  405.                 char = ent.Character
  406.             else
  407.                 ent = FindPlayer(Entity)
  408.                 char = Entity.Character
  409.             end
  410.             Sound = Instance.new("Sound", char)
  411.             Sound.Name = "PlayerSound"
  412.             Sound.SoundId = "rbxassetid://"..SoundSource
  413.             Sound.Volume = Volume
  414.             Sound.Pitch = Pitch
  415.             Sound:Play()
  416.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  417.                 Text = "Playing sound "..SoundSource.." for entity (player) "..ent.Name;
  418.                 Font = Enum.Font.SourceSansBold;
  419.                 Color = Color3.new(255, 255, 255); 
  420.             })
  421.         else
  422.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  423.                 Text = "<SoundSource> <EntityType> <Volume> <Pitch>";
  424.                 Font = Enum.Font.SourceSansBold;
  425.                 Color = Color3.new(255, 0.2, 0);   
  426.             })
  427.         end
  428.     end,
  429.     ["stopsound"] = function(args)
  430.         for i, argums in pairs(args) do
  431.             print(argums)
  432.         end
  433.         local Entity = args[1]
  434.         if Entity then
  435.             local ent
  436.             local char
  437.             if Entity == "@s" then
  438.                 ent = player
  439.                 char = ent.Character
  440.             elseif Entity == "@p" then
  441.                 ent = player
  442.                 char = ent.Character
  443.             elseif Entity == "@a" then
  444.                 for _, v in pairs(game.Players:GetPlayers()) do
  445.                     ent = v
  446.                     char = ent.Character
  447.                 end
  448.             elseif Entity == "@r" then
  449.                 UpdatePlayers()
  450.                 local randomPlr = players[math.random(1, #players)]
  451.                 ent = randomPlr
  452.                 char = ent.Character
  453.             else
  454.                 ent = FindPlayer(Entity)
  455.                 char = Entity.Character
  456.             end
  457.             local CurrentSound = char:FindFirstChild("PlayerSound")
  458.             if CurrentSound then
  459.                 CurrentSound:Destroy()
  460.                     game.StarterGui:SetCore("ChatMakeSystemMessage", {
  461.                     Text = "Stopping sound for the entity "..ent.Name;
  462.                     Font = Enum.Font.SourceSansBold;
  463.                     Color = Color3.new(255, 255, 255);
  464.                 })
  465.             else
  466.                 game.StarterGui:SetCore("ChatMakeSystemMessage", {
  467.                     Text = "The current entity "..ent.Name.."'s sound had not found.";
  468.                     Font = Enum.Font.SourceSansBold;
  469.                     Color = Color3.new(255, 0.2, 0);   
  470.                 })
  471.             end
  472.         else
  473.             game.StarterGui:SetCore("ChatMakeSystemMessage", {
  474.                 Text = "<EntityType>";
  475.                 Font = Enum.Font.SourceSansBold;
  476.                 Color = Color3.new(255, 0.2, 0);   
  477.             })
  478.         end
  479.     end,
  480. }
  481.  
  482. --Events
  483. player.Chatted:Connect(function(msg)
  484.     msg = string.lower(msg)
  485.     local split = msg:split(" ")
  486.     local slash = split[1]
  487.     local cmd = slash:split(CommandArgum)
  488.     local cmdName = cmd[2]
  489.     if Commands[cmdName] then
  490.         local arguments = {}
  491.         for i = 2, #split, 1 do
  492.             table.insert(arguments, split[i])
  493.         end
  494.         Commands[cmdName](arguments)
  495.     end
  496. end)
  497. game.Players.ChildAdded:Connect(function()
  498.     UpdatePlayers()
  499. end)
  500. game.Players.ChildRemoved:Connect(function()
  501.     UpdatePlayers()
  502. end)
  503. end))
  504. for i,v in pairs(mas:GetChildren()) do
  505.     v.Parent = game:GetService("Players").LocalPlayer.PlayerScripts
  506.     pcall(function() v:MakeJoints() end)
  507. end
  508. mas:Destroy()
  509. for i,v in pairs(cors) do
  510.     spawn(function()
  511.         pcall(v)
  512.     end)
  513. end
  514.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement