Categories > Exploiting > Scripts >
Chat command
Posted
If Player with userid 1111 said "something" then
check if local player.userid == 1111 and if it is then cancel
if it isnt teleport to cframe
Please Help
Replied
Would this work? Can't guarantee it'll work, sorry if that's the case
local Players = game:GetService ("Players");
local LocalPlayer = Players.LocalPlayer;
local Command = "/tp"; --Change whatever style you want, like (;tp or ;tp)
--Teleports to the player mentioned by your command
local function Teleport (Player)
--Checks if both you and your target's character exist
if (Player ~= nil and Player.Character ~= nil and LocalPlayer.Character ~= nil) then
local CurrentPosition = LocalPlayer.Character:GetPivot (); --Your character's CFrame position
local TargetPosition = Player.Character:GetPivot (); --Your Target's character's CFrame position
LocalPlayer.Character:PivotTo (CurrentPosition + (TargetPosition.Position - CurrentPosition.Position + Vector3.new (0,0,0))); --Vector3.new (0,0,0) is an offset that you can modify;
end
end
--Checks the name list of existing players
local function CheckPlayer (Message)
for _, Player in pairs (Players:GetPlayers ()) do
if (Player ~= LocalPlayer) then
if (string.match (string.lower (Message), string.lower (Player.Name)) ~= nil or string.match (string.lower (Message), string.lower (Player.DisplayName)) ~= nil or string.match (string.lower (Message), Player.UserId) ~= nil) then
return Player; --Returns an existing player
else
return nil; --Returns nothing
end
end
end
end
--Listens for your chat messages
LocalPlayer.Chatted:Connect (function (Message)
--Check if the sent chat message was a command
print ("Message sent: " .. tostring (Message));
if (string.match (string.lower (Message), string.lower (Command)) ~= nil) then
print ("Command detected in message");
local Player = CheckPlayer (Message); --Returns either an existing player, or nil
if (Player ~= nil) then
print ("Player found, teleporting...");
Teleport (Player);
end
end
end);
--Indicates that the script works, press F9 in-game to see if it's loaded or not
print ("Loaded!");
What this does:
1.) It'll listen to your chat messages and see if your message is a command by matching it with "/tp" command.
2.) If "/tp" is detected in your messages, it will check the additional text along with the "/tp", like "/tp genericusername123" and see if that player exist
3.) It tries to match player's identification (Player.Name, Player.DisplayName, and Player.UserId), if the mentioned name matches to the existing player, it'll trigger the teleport function
4.) Teleport function moves your whole character to the same place where the target player's character is also located
Cancel
Post
Added
Oh wait, I think I misread the main thread text, so you mean make the script listen to other player's messages and make them teleport to certain CFrame if they say it?
If you're gonna use it on your own game, it'll work (with some modifications, replacing LocalPlayer with Player), though using it for an exploit won't work, because I experienced that issue
Cancel
Post
Added
Here, maybe this was you're looking for?
local Players = game:GetService ("Players");
local LocalPlayer = Players.LocalPlayer;
local TriggerMsg = "Whatever message you want to put here"; --Triggers a teleport function if this string matches to the player's chat message
local Destination = CFrame.new (0,0,0); --Change this to whatever destination you want the player to teleport at
--Teleports the player to certain destination/position
local function Teleport (Player)
--Checks if player's character exist, it won't teleport the player if it's dead or hasn't loaded yet
if (Player ~= nil and Player.Character ~= nil) then
local TargetPosition = Player.Character:GetPivot ();
Player.Character:PivotTo (TargetPosition + (Destination.Position - TargetPosition.Position + Vector3.new (0,0,0))); --Vector3.new (0,0,0) is an offset that you can modify;
end
end
local function Chat (Player)
--Listens to other player's messages
Player.Chatted:Connect (function (Message)
--Checks if the message matches with your certain code-word/trigger message
if (string.match (string.lower (Message), string.lower (TriggerMsg)) ~= nil) then
Teleport (Player);
end
end);
end
--Checks for existing players
for _, Player in pairs (Players:GetPlayers ()) do
if (Player ~= LocalPlayer) then
Chat (Player);
end
end
--Checks for joining players
Players.PlayerAdded:Connect (function (Player)
if (Player ~= LocalPlayer) then
Chat (Player);
end
end);
Note: This should be used on your own game, it won't work as an exploit since Player.Chatted isn't gonna return an output if used on client anymore
Cancel
Post
ÂÂÂ
Replied
Ye i wanted for an exploit but thanks for telling me that it does not work anymore.
Oh and btw can u tell me how does the swagmode premium work rn?
Cuz im kinda confused on how this does not work on a executor but swagmode prem works
Cancel
Post
Replied
@Produde69420123 I haven't heard of Swagmode yet, so I'm not sure if it works or not, I did try searching for it and saw this (short version), it uses the same Player.Chatted event so I can't tell you if it'll work or not, hope this helps
Edit: As for premium version, I don't know how it works since it's obfuscated and was only made exclusively for Da Hood, perhaps it was using a different method other than Player.Chatted since you said it works
Cancel
Post
ÂÂÂ
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post