RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"teleport chat command for only players who has bool value of Guardian."
-- server script local Players = game:GetService("Players") local function onPlayerChatted(player, message) local args = string.split(message, " ") if args[1] == "!teleport" and player.Guardian.Value then if args[2] and args[3] then local targetPlayer = Players:FindFirstChild(args[2]) local destinationPlayer = Players:FindFirstChild(args[3]) if targetPlayer and destinationPlayer then local targetCharacter = targetPlayer.Character local destinationCharacter = destinationPlayer.Character if targetCharacter and destinationCharacter then local destinationPosition = destinationCharacter.HumanoidRootPart.Position targetCharacter.HumanoidRootPart.CFrame = CFrame.new(destinationPosition) end end end end end Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) onPlayerChatted(player, message) end) end)