Facebook
From fhu9g9hg9rhjgiowriguow, 5 Months ago, written in Plain Text.
This paste is a reply to Re: Re: skibideez from ezezez - view diff
Embed
Download Paste or View Raw
Hits: 168
  1. local gyro = GetPartFromPort(1, "Gyro")
  2.  
  3. -- Gets the player's info
  4. local function getPlayerInfo(playerName)
  5.     -- TODO: replace this with a real function that fetches the player's info from the Roblox leaderboard API
  6. end
  7.  
  8. -- Set up motor pins
  9. local motorPins = {12, 13, 14} -- {1:Left Motor, 2:Right Motor, 3:Vertical Motor}
  10. -- Set up speed for motors
  11. local speed = 50 -- speed value between 0 and 100
  12.  
  13. -- Target player to follow
  14. local targetPlayer = "Player" -- name of the player to follow
  15.  
  16. -- Function to start targeting a player
  17. function target(playerName)
  18.     targetPlayer = playerName
  19.     print("Now following " .. targetPlayer .. " in leaderboard roblox list.")
  20. end
  21.  
  22. -- Function to stop targeting a player
  23. function stopTargeting()
  24.     targetPlayer = nil
  25.     print("Stopped targetting the player in leaderboard roblox list.")
  26. end
  27.  
  28. -- Main loop
  29. while true do
  30.     if targetPlayer then
  31.         local playerInfo = getPlayerInfo(targetPlayer)
  32.         if playerInfo then
  33.             local targetAngle = math.atan2(playerInfo.Y - 50, playerInfo.X - 50) * 180 / math.pi
  34.             gyro.targetRotationY(targetAngle)
  35.         else
  36.             print("Player not found in leaderboard roblox list.")
  37.         end
  38.     end
  39.     wait(0.05)
  40. end

Replies to Re: Re: Re: skibideez rss

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