Facebook
From ezezez, 5 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 166
  1. local function getPlayerInfo(playerName) -- get the player's info
  2.     -- TODO: replace this with a real function that fetches the player's info from the Roblox leaderboard API
  3. end
  4.  
  5. local motorPins = {12, 13, 14} -- {1:Left Motor, 2:Right Motor, 3:Vertical Motor}
  6. local speed = 50 -- speed value between 0 and 100
  7. local targetPlayer = "Player" -- name of the player to follow
  8.  
  9. gyro.init()
  10. bt.init()
  11. bt.connect("GYRO-6000")
  12.  
  13. motor.setup(motorPins, speed)
  14.  
  15. function target(playerName)
  16.     targetPlayer = playerName
  17.     print("Now following " .. targetPlayer .. " in leaderboard roblox list.")
  18. end
  19.  
  20. function stopTargeting()
  21.     targetPlayer = nil
  22.     print("Stopped targetting the player in leaderboard roblox list.")
  23. end
  24.  
  25. while true do
  26.     if targetPlayer then
  27.         local playerInfo = getPlayerInfo(targetPlayer)
  28.         if playerInfo then
  29.             local targetAngle = atan2(playerInfo.Y - 50, playerInfo.X - 50) * 180 / pi
  30.             gyro.targetRotationY(targetAngle)
  31.         else
  32.             print("Player not found in leaderboard roblox list.")
  33.         end
  34.     end
  35.     wait(0.05)
  36. end

Replies to skibideez rss

Title Name Language When
Re: skibideez ezezez text 5 Months ago.