Same script as before i just added another command into it.. and another issue popped out output says problem in line 89 and 63 after stack begining
local commands = {}
local prefix = "/"
local admins = {
"GamerOx_23"
}
local function findPlayer(name)
for i, player in pairs(game.Players:GetPlayers()) do
if string.lower(player.Name) == name then
return player
end
end
return nil
end
local function isAdmin(player)
for _, v in pairs(admins) do
if v == player.Name then
return true
end
end
return false
end
commands.tp = function(sender, arguments)
print("TP Function fired by" .. sender.Name)
for i, playerName in pairs(arguments) do
print(playerName)
end
local playerToTeleportName = arguments[1]
local playerToTeleportToName = arguments[2]
if playerToTeleportName and playerToTeleportName then
local plrToTP = findPlayer(playerToTeleportName)
local plrToTpTo = findPlayer(playerToTeleportName)
if plrToTP and plrToTpTo then
plrToTP.Character:WaitForChild("HumanoidRootPart").CFrame =
plrToTpTo.Character:WaitForChild("HumanoidRootPart").CFrame
print("It fricking worked")
end
end
end
commands.speed = function(sender, arguments) --"/speed me 30" ---> arguments["me","30"]
print("Speed command fire by "..sender.Name)
local playerToGiveSpeedTo = arguments[1]
local amountOfSpeedToGive = arguments[2]
if playerToGiveSpeedTo then
local plr = findPlayer(playerToGiveSpeedTo)
if plr then
plr.Character.Humanoid.WalkSpeed = tonumber(amountOfSpeedToGive)
print(playerToGiveSpeedTo.." was given Walkspeed".. amountOfSpeedToGive)
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message, recipient)
if isAdmin(player) then
message = string.lower(message)
local splitString = message:split(" ")
local slashCommand = splitString[1]
local cmd = slashCommand:split(prefix)
local cmdName = cmd[2]
if commands[cmdName] then
local arguments = {}
for i = 2, #splitString, 1 do
table.insert(arguments, splitString[i])
end
commands[cmdName](player, arguments)
end
end
end)
end)

2 comments
i fixed it please ignore this question!
You should put "[Solved]" in the title so people know.