generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Help with finish line and placings

Previous Thread :: Next Thread 
Krimulous is not online. Krimulous
Joined: 17 Mar 2011
Total Posts: 7993
16 Aug 2016 03:00 AM
I'd like to create a script that can keep track of who touched the finish line, but I don't know how to get the order that the players touch the finish line. I assume it'd be with some values but I don't know where to start with that. (1st place, 2nd place, 3rd place, etc)

I've got this for reference:

FinishLine.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
end
end)

If someone could add on to it or link me to a helpful resource that would be appreciated.





Report Abuse
Aangman3456 is not online. Aangman3456
Joined: 24 Nov 2011
Total Posts: 132
16 Aug 2016 03:07 AM
local player = game:GetService("Players").LocalPlayer
local place
local finished = false

for i = 1, maxplayers, -1 do
FinishLine.Touched:connect(function(hit)
local character = hit.Parent
if character:FindFirstChild("Humanoid") then
if finished == true then return end
finished = true
place = i
print(player.Name.." has finished with a rank of: "..place"!")
end
end)
end

Just something off the top of my head, hope it helps


Add 401 to display your RAP.
Report Abuse
Krimulous is not online. Krimulous
Joined: 17 Mar 2011
Total Posts: 7993
16 Aug 2016 03:28 AM
Thanks for the response Aang, but I was looking for a way to store the names so that I could retrieve them later in the round as part of a ceremony. How could I do that?

Also, I need it in a regular script, rather than a local script.


Report Abuse
Krimulous is not online. Krimulous
Joined: 17 Mar 2011
Total Posts: 7993
16 Aug 2016 02:37 PM
bump

Also, I figured out how to store names and keep track of places.

Problem is, I don't know how to add a debounce so that a player can't simultaneously have their name stored in a value as multiple places. (Place1, Place2, Place3, etc.)

Can someone help with adding a debounce or something so that a player can only get one value towards them? (Place# and their name in the value)

FinishLine.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local str = Instance.new("StringValue")
str.Name = "Place"..place
str.Value = hit.Parent.Name
str.Parent = FinishLine
place = place + 1
end
end)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image