Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom commands script, needs help with message? [closed]

Asked by 8 years ago
Edited 8 years ago
local Admins = ("")
local Prefix = "/" 

for i,v in pairs(Admins) do--Get Some Admins
 game.Players(Admins)(i)).Chatted:connect(function(mag) --idk stuff here that you suold not change
  if mag:lower() == Prefix .. "shutdown" then
   game.Players:ClearAllChildren() -- Removes All The Players
   game.Workspace:ClearAllChildren() --- Removes All Things In Workspace
  end

  if mag:lower() == Prefix .. "ff me" then
   Inatance.new {"ForceField". game.Players(Admins(i)).Character)
  end

  if mag:lower() == Prefix .. "unff me" then
   while wait() do
   game.Players(Admins(i)).Character.ForceField:Destroy()
   end
  end

  if mag:lower() == Prefix .. "freeze me" then
   game.Players(Admins(i)).Character.Torso.Anchored = true
   game.Players(Admins(i)).Character.HumanoidRootPart.Anchored = true

  end
 end)
end

These are the commands ive made so far, but what I want to do is to make a command so that if I do !hi it broadcasts a message saying "Hi!".

0
Curly brackets aren't for everything. You have to use brackets [ ] or parentheses ( ) in most of the cases that you're currently using curly brackets. Perci1 4988 — 8y
0
For example, where it says pairs{Admins}, it should be pairs(Admins). {} are generally for tables. EzraNehemiah_TF2 3552 — 8y
0
You can call a function using only curly braces `foo { 1, 2 }` instead of `foo({ 1, 2 })` when the only argument is a table literal, but that's it. Link150 1355 — 8y
0
Fixed the curky brackets, Arkevos 0 — 8y
View all comments (2 more)
0
When you're getting values from tables you still use []. and the admin's table has to have {} EzraNehemiah_TF2 3552 — 8y
0
So remember it this way, functions use (), when getting values from a table you use [], when using a table you use {} EzraNehemiah_TF2 3552 — 8y

Closed as Not Constructive by EzraNehemiah_TF2 and User#6546

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?