So, hey, im doing an admin command system and just started, but i got kinda stuck:
im doing a teleport command, and i got stuck to detect if the values of the command message are correct, so i have 2 Module Scripts, 1 for handling all the commands, and other for the teleport command:
this modules are in ReplicatedStorage, this is the one who handles the commands:
local adminCmds = {}
local tpCmd = require(script.TeleportCmd)
function tp(plr, pos, addY, addPos)
tpCmd.Teleport(plr, pos, addY, addPos)
end
return adminCmds
and this is the module for the teleport command:
local teleportCmd = {}
function teleportCmd.Teleport(plr, pos, addY, addPos)
local char = plr.Character
if char then
if addY then
char.HumanoidRootPart.CFrame = CFrame.new(pos) + Vector3.new(0, addPos, 0)
else
char:MoveTo(pos)
end
end
end
return teleportCmd
this script (a ServerScript in ServerScriptService) is the one who handles when the player sends the chat command:
local commandsModule = require(game.ReplicatedStorage.Modules.AdminCmds)
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local loweredText = string.lower(msg)
if string.find(loweredText, "/tp") then
end
end)
end)
but i got kinda stuck in here cause idk how to get the pos, the boolean, and the numberValue…
thanks!