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: OnPlayerEnter giving IntValues to them

Previous Thread :: Next Thread 
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
03 Feb 2012 07:18 PM
function OnPEnter(newplayer)
staty = Instance.new("IntValue")
lv1 = Instance.new("IntValue")
lv2 = Instance.new("IntValue")
--!
staty.Name = "Coins"
lv1.Name = "Attack"
lv2.Name = "Def"
staty1.Parent = newplayer
lv1.Parent = newplayer
lv2.Parent = newplayer
--!
end
game.Players.PlayerAdded:connect(onPEnter)


Why does this not work? Looks clean.
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
03 Feb 2012 07:36 PM
Bumpety BUMP bUMP
Report Abuse
LuisPambid is not online. LuisPambid
Joined: 31 Mar 2011
Total Posts: 532
03 Feb 2012 08:09 PM
function OnPEnter(newplayer)
staty = Instance.new("IntValue")
lv1 = Instance.new("IntValue")
lv2 = Instance.new("IntValue")
--!
staty.Name = "leaderboard" --Make this a leaderboard.
lv1.Name = "Attack"
lv2.Name = "Def"
staty1.Parent = newplayer
lv1.Parent = newplayer
lv2.Parent = newplayer
--!
end
game.Players.PlayerAdded:connect(onPEnter)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
03 Feb 2012 08:15 PM
I fixes Luis's script.

function OnPEnter(newplayer)
staty = Instance.new("IntValue")
lv1 = Instance.new("IntValue")
lv2 = Instance.new("IntValue")
--!
staty.Name = "leaderstats" --Make this a leaderboard.
lv1.Name = "Attack"
lv2.Name = "Def"
staty.Parent = newplayer
lv1.Parent = staty
lv2.Parent = staty
--!
end
game.Players.PlayerAdded:connect(onPEnter)

† KMXD †
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
03 Feb 2012 08:44 PM
Coins Attack Def

game.Players.PlayerAdded:connect(function(new)
stats = Instance.new("IntValue", new)
stats.Name = "leaderstats"
--
Instance.new("IntValue", stats).Name = "Coins"
Instance.new("IntValue", stats).Name = "Attack"
Instance.new("IntValue", stats).Name = "Def"
end)
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
03 Feb 2012 09:32 PM
game.Players.PlayerAdded:connect(function(newPlayer)

stats = Instance.new("IntValue", newPlayer)
stats.Name = "leaderstats"

p = Instance.new("IntValue", stats)
p.Name = "Coins"

g = Instance.new("IntValue", stats)
g.Name = "Attack"

f = Instance.new("IntValue", stats)
f.Name = "Def"

end)


you might wanna use those don't cha?
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
03 Feb 2012 11:40 PM
Use adark's, but you might want to change it to child added because player added doesn't work in test mode.
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
04 Feb 2012 08:07 AM
Yes it does?
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
04 Feb 2012 08:45 AM
No. All I want to do is insert IntValues into them. Not create a leaderstat. Uggg
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
04 Feb 2012 08:50 AM
Ohhh. Then just remove the part where it instances the leaderstats int.
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
04 Feb 2012 08:59 AM
[ Content Deleted ]
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
04 Feb 2012 02:46 PM
^^^ dont work because p is issued as player, then it gets issued as the int value. once you do that it will malfunction. It will make everything go in coins.
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
04 Feb 2012 02:47 PM
[ Content Deleted ]
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
04 Feb 2012 02:53 PM
Here, I made it the hard, but complete way. He made it so that it puts the leaderstats leaderstats in the player, so it don't work! xD This really is if you want to add function to the seperate Values.

------------------------------------------------------------------
game.Players.PlayerAdded:connect(function (pl)

makeLeaderStats()
giveCoins()
giveAttack()
giveDefense()

end)

function giveCoins()

coins = Instance.new("IntValue", ls).Name = "Coins"
end

function giveAttack()

attack = Instance.new("IntValue", ls).Name = "Attack"

end

function giveDefense()

defense = Instance.new("IntValue", ls).Name = "Defense"

end

function makeLeaderStats()

ls = Instance.new("IntValue", pl).Name = "leaderstats"

end
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
04 Feb 2012 02:55 PM
oh i forgot, take the leader stats off and switch ls to pl and there you go, its not in leaderstats.
Report Abuse
Intune is not online. Intune
Joined: 02 Feb 2012
Total Posts: 50
04 Feb 2012 03:05 PM
@cody

That wont work because you never reference 'ls'
Report Abuse
Intune is not online. Intune
Joined: 02 Feb 2012
Total Posts: 50
04 Feb 2012 03:06 PM
@cody

Sorry, didn't read your second post.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
04 Feb 2012 09:44 PM
@cody; Your script is terrible.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
07 Feb 2012 10:42 AM
if you look my first function connect to the last function. LS is then assigned as the leader board.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Feb 2012 03:59 PM
Yes, I read your script. No offense, but most of the lines are so unnecessary it makes me wanna explode.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
08 Feb 2012 09:55 AM
I know i ment that...

I KNOW WHAT THE PROBLEM WITH HIS FIRST SCRIPT WAS! NUMBERS!!!! YOU CANNOT USE NUMBERS IN VARIABLES!
######38572893758923897582375827835789357981089501375073######
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
08 Feb 2012 11:18 AM
[ Content Deleted ]
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
08 Feb 2012 03:45 PM
Yes you can, the numbers just cannot be seperated from the variable name.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
10 Feb 2012 06:12 PM
Bump :3

Yea those numbers are not working for me either way. Together (which i tried the first time and then seperate)
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