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 » Scripting Helpers
Home Search
 

Re: This won't work!

Previous Thread :: Next Thread 
CBD55 is not online. CBD55
Joined: 26 Apr 2011
Total Posts: 347
01 Feb 2013 06:31 PM
script.Parent.Touched:connect(function(touch)
local player = Game.Players:GetPlayerFromCharacter(touch.Parent)
if player and player:findFirstChild("leaderstats") then
local stats = player.leaderstats.Points
if stats.5.Value < 1 then
stats.5.Value = leaderstats.Points.Value + 1
end
end
end)
Report Abuse
Inordinatus is not online. Inordinatus
Joined: 24 Dec 2012
Total Posts: 155
01 Feb 2013 06:35 PM
if stats.5.Value < 1 then
stats.5.Value = leaderstats.Points.Value + 1 -- leaderstats is undefined

I'm not sure if "5" is the value of the stats, or what. But here's my guess:

if stats.5.Value < 1 then
stats.5.Value = stats.Value + 1

ιησя∂ιηαтυѕ
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
01 Feb 2013 06:35 PM

stats.5.Value?
Report Abuse
CBD55 is not online. CBD55
Joined: 26 Apr 2011
Total Posts: 347
01 Feb 2013 07:19 PM
I have a leader board script too, do you want to see that?
Report Abuse
FisherPenguin is not online. FisherPenguin
Joined: 14 Jun 2010
Total Posts: 1157
01 Feb 2013 07:25 PM
Make sure it is ("leaderstats"), and not ("Leaderstats"). CAPS matter :P



+-Fishy
Report Abuse
CBD55 is not online. CBD55
Joined: 26 Apr 2011
Total Posts: 347
01 Feb 2013 07:26 PM
Thanks
Report Abuse
jessdiesthird is not online. jessdiesthird
Joined: 22 Nov 2012
Total Posts: 401
01 Feb 2013 08:40 PM
i did they before someone of theam dont work :(
Report Abuse
CBD55 is not online. CBD55
Joined: 26 Apr 2011
Total Posts: 347
02 Feb 2013 06:50 AM
This is my leader board script:

function CreateStats(NewPlayer)
local MainStats = Instance.new("IntValue")
MainStats.Name = "leaderstats"
MainStats.Value = 0
local PointsValue = Instance.new("IntValue")
PointsValue.Name = "Points"
PointsValue.Value = 0
PointsValue.Parent = MainStats
MainStats.Parent = NewPlayer
return MainStats
end
game.Players.ChildAdded:connect(CreateStats)



And this is my point brick script:


script.Parent.Touched:connect(function(touch)
local player = Game.Players:GetPlayerFromCharacter(touch.Parent)
if player and player:findFirstChild("leaderstats") then
local stats = player.leaderstats.Points
if stats.Value < 1 then
stats.Value = stats.Value + 1
stats.Value = leaderstats.Points.Value + 1
end
end
end)


Do you think there is any roblems with them connecting?
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
02 Feb 2013 06:51 AM
[ Content Deleted ]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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