local function getPlayerInfo(playerName) -- get the player's info -- TODO: replace this with a real function that fetches the player's info from the Roblox leaderboard API end local motorPins = {12, 13, 14} -- {1:Left Motor, 2:Right Motor, 3:Vertical Motor} local speed = 50 -- speed value between 0 and 100 local targetPlayer = "Player" -- name of the player to follow gyro.init() bt.init() bt.connect("GYRO-6000") motor.setup(motorPins, speed) function target(playerName) targetPlayer = playerName print("Now following " .. targetPlayer .. " in leaderboard roblox list.") end function stopTargeting() targetPlayer = nil print("Stopped targetting the player in leaderboard roblox list.") end while true do if targetPlayer then local playerInfo = getPlayerInfo(targetPlayer) if playerInfo then local targetAngle = atan2(playerInfo.Y - 50, playerInfo.X - 50) * 180 / pi gyro.targetRotationY(targetAngle) else print("Player not found in leaderboard roblox list.") end end wait(0.05) end