Guest User

Very simple cmd

a guest
Apr 11th, 2025
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.97 KB | None | 0 0
  1. local InsertService = game:GetService("InsertService")
  2. local pistolssetId = 24073203 -- GUN_ID
  3. local truckassetId = 83291374
  4. local lplr = game.Players.LocalPlayer
  5.  
  6. --workspace.Baseplate:Destroy()
  7.  
  8. --say ;pistol to spawn it
  9.  
  10. --mech id - 85853456
  11. --kart id - 85773796
  12.  
  13. function spawnAsset(plr, assetId)
  14.     local asset = InsertService:LoadAsset(assetId)
  15.     asset.Parent = workspace
  16.     asset:MoveTo(workspace[plr].Torso.Position)
  17.     asset:MakeJoints()
  18. end
  19.  
  20.  
  21. function chatted(msg)
  22.     if msg:sub(1, 7) == ";pistol" and #msg == 7 then
  23.         spawnAsset(lplr.Name, pistolssetId)
  24.     elseif msg:sub(1, 7) == ";pistol" and #msg > 7 then
  25.         if workspace:findFirstChild(msg:sub(9,#msg)) then
  26.             spawnAsset(msg:sub(9,#msg), pistolssetId)
  27.         end
  28.     end
  29.  
  30.     if msg:sub(1,8) == ";explode" and #msg == 8 then
  31.         local ex = Instance.new("Explosion", lplr.Character.Torso)
  32.         ex.Position = lplr.Character.Torso.Position
  33.     elseif msg:sub(1,8) == ";explode" and #msg > 8 then
  34.         if workspace:findFirstChild(msg:sub(10,#msg)) then
  35.             local ex = Instance.new("Explosion", workspace:findFirstChild(msg:sub(10,#msg)).Torso)
  36.             ex.Position = workspace:findFirstChild(msg:sub(10,#msg)).Torso.Position
  37.         end
  38.     end
  39.  
  40.     if msg:sub(1,7) == ";insert" and #msg >= 9 then
  41.         pcall(spawnAsset(lplr.Name, msg:sub(9,#msg)))
  42.     end
  43.  
  44.     if msg:sub(1,6) == ";truck" and #msg == 6 then
  45.         spawnAsset(lplr.Name, truckassetId)
  46.     elseif msg:sub(1,6) == ";truck" and #msg > 6 then
  47.         if workspace:findFirstChild(msg:sub(8,#msg)) then
  48.             spawnAsset(msg:sub(8,#msg), truckassetId)
  49.         end
  50.     end
  51. end
  52.  
  53. game.Players.LocalPlayer.Chatted:connect(chatted)
  54.  
  55. game:GetService("Chat"):Chat(lplr.Character.Head,"Commands Loaded. Made by: Cazum93")
  56. wait(3)
  57. game:GetService("Chat"):Chat(lplr.Character.Head,"Prefix is: ';', CMDS: pistol, explode, insert, truck. To use the command on you, dont put the player's name")
Advertisement
Add Comment
Please, Sign In to add comment