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
 

Re: Displaying scores

Previous Thread :: Next Thread 
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
03 Jan 2015 04:33 PM
Hi guys!
I have a brick with a script in that remembers everyone that touches it and at the end it displays who touched it - that is working fine. But now I need it in a model and it doesn't work in a model - any ideas why? Here's the script:
Another problem, is that there is more than one of these in the game - I kinda also need a way to run only THE one that is touched or something.
Any help would be appreciated! Thanks



local Winners = {};
script.Parent.Touched:connect(function(hit)--when the brick is touched
print ("Player touched!")
for key, value in next, Winners do
if value == hit.Parent.Name then
return
end
end
table.insert(Winners, hit.Parent.Name)
end);
game.Workspace.Time.Changed:connect(function(newValue)
if newValue == 0 then --if the time is equal to 1 then
hdd= game.Workspace.Announcer
end
if #Winners == 0 then
hdd.Text = "Nobody Escaped."
else
hdd.Text = "The players that Escaped are: "..table.concat(Winners, ", "); --display the winners in a message
wait(3)
hdd.Text = ""
for key, value in next, Winners do
local c = game.Players[value].leaderstats.Coins
c.Value = c.Value + 10;
end
end
end);
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
03 Jan 2015 04:49 PM
Bump! :) :)
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
03 Jan 2015 04:53 PM
Help please!
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
03 Jan 2015 04:55 PM
script inside of the model

local Winners = {};
for i,v in pairs(script.Parent:GetChildren())
if v:IsA('Part') then
v.Touched:connect(function(hit)--when the brick is touched
print ("Player touched!")
for key, value in next, Winners do
if value == hit.Parent.Name then
return
end
end
table.insert(Winners, hit.Parent.Name)
end);
game.Workspace.Time.Changed:connect(function(newValue)
if newValue == 0 then --if the time is equal to 1 then
hdd= game.Workspace.Announcer
end
if #Winners == 0 then
hdd.Text = "Nobody Escaped."
else
hdd.Text = "The players that Escaped are: "..table.concat(Winners, ", "); --display the winners in a message
wait(3)
hdd.Text = ""
for key, value in next, Winners do
local c = game.Players[value].leaderstats.Coins
c.Value = c.Value + 10;
end
end
end
end
end);
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
03 Jan 2015 04:57 PM
Doesn't work :( When the time is set to 0 (or any other time) it says "Players that Escaped: Workspace" (Also, bear in mind i have more then one of those scripts in the game in a model)
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
03 Jan 2015 05:05 PM
Help! :(
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
03 Jan 2015 05:28 PM
Bump!
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
03 Jan 2015 06:41 PM
Anyone? :(
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
04 Jan 2015 02:28 PM
Bump!
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
04 Jan 2015 02:39 PM
:( :(
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
04 Jan 2015 02:43 PM
Is there another more efficient way of doing this or something?
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
04 Jan 2015 02:47 PM
Anyone?? :(
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
04 Jan 2015 02:53 PM
Basically, I just need an efficient way to collect the names of players that touched a brick in a round so I can display them on a Gui :(
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
04 Jan 2015 03:06 PM
:(
Report Abuse
jjwood1600 is online. jjwood1600
Joined: 14 May 2013
Total Posts: 1633
05 Jan 2015 09:57 AM
Bump!
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