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: Re:

Previous Thread :: Next Thread 
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 06:58 PM
How can I edit this so players don't lose any points if they have a certain game pass?

LoseAmount = 50
local Players = Game:GetService("Players")
Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
local Humanoid = Character:FindFirstChild("Humanoid")
if Humanoid then
Humanoid.Died:connect(function()
Player.leaderstats.XP.Value = Player.leaderstats.XP.Value - LoseAmount
end)
end
end)
end)
Report Abuse
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
25 Nov 2012 07:26 PM
Like a boss?
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
25 Nov 2012 07:54 PM
http://wiki.roblox.com/index.php/UserHasBadge_(Method)

Use that to check if the person has the game pass, then run whatever code you want.
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
25 Nov 2012 08:42 PM
Where ever you put the rewarding points, make it like this

if p:UserHasBadge(12345678)==nil then
p.leaderstats.Points.Value = p.leaderstats.Points.Value - math.random(50,100)
end

Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 08:46 PM
Guys, he is talking about GamePasses. I would post the script, but apparently Roblox thinks I'm exchanging information. . .

¤¤ †KMXD† ¤¤
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 08:50 PM
@Raphael7

Did you not read the script? It's taking away points, not giving you them.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 08:51 PM
Essentially, you would use the :PlayerHasPass() method, and if true, return.

You could also check if it's not true, and continue, if that's easier.

http://wiki.roblox.com/index.php/Game_Pass

¤¤ †KMXD† ¤¤
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 08:54 PM
I don't know how to edit it.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 08:55 PM
Just add a line with the method right before taking away the points.

¤¤ †KMXD† ¤¤
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
25 Nov 2012 08:55 PM
Then make the script add. Easy to change.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 08:58 PM
What would be the line? I can't script well at all?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:04 PM
Look at the link I gave you. It will tell you how to use the method, that's what you need.

¤¤ †KMXD† ¤¤
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
25 Nov 2012 09:05 PM
teach him about if statements, bools and methods and playerAdded

etc
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 09:12 PM
I don't know how to do it. Can't you just send me the script in a PM if it won't let you do it on here?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:14 PM
Did you try reading it? You have to add:


    if Game:GetService("GamePassService"):PlayerHasPass(Player, passId) then return end

¤¤ †KMXD† ¤¤
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
25 Nov 2012 09:15 PM
UMG DOOD TOO MUCH ":", "()", """"
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 09:17 PM
I did, but I don't know where the game pass ID would.
Report Abuse
LUVMARIOLUIGI10000 is not online. LUVMARIOLUIGI10000
Joined: 16 May 2009
Total Posts: 1244
25 Nov 2012 09:18 PM
The game pass ID goes in the second slot, after the playerId.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
25 Nov 2012 09:18 PM
in the parameter part, the second argument should be the pass id
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
25 Nov 2012 09:20 PM
Watch this, it will help you learn how to do it:

https://www.youtube.com/watch?v=j-EvW4bkAxc
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 09:20 PM
So "then return end" all goes in the same line?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:21 PM
Yes, unless you want to add a not and an end.

Actually, it doesn't have to be on the same line, but it would be easier that way.

¤¤ †KMXD† ¤¤
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 09:21 PM
@yo

I know you're trying to troll, so no.
Report Abuse
legend8887 is not online. legend8887
Joined: 06 Nov 2010
Total Posts: 13765
25 Nov 2012 09:22 PM
So post that line before the lose points?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Nov 2012 09:22 PM
Yes.

¤¤ †KMXD† ¤¤
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