|
| 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
|
  |
| Joined: 11 Feb 2010 |
| Total Posts: 3231 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 25 Nov 2012 08:50 PM |
@Raphael7
Did you not read the script? It's taking away points, not giving you them. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 25 Nov 2012 08:54 PM |
| I don't know how to edit it. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 08:55 PM |
Just add a line with the method right before taking away the points.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 25 Nov 2012 08:55 PM |
| Then make the script add. Easy to change. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 08:58 PM |
| What would be the line? I can't script well at all? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 25 Nov 2012 09:05 PM |
teach him about if statements, bools and methods and playerAdded
etc |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 25 Nov 2012 09:15 PM |
| UMG DOOD TOO MUCH ":", "()", """" |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:17 PM |
| I did, but I don't know where the game pass ID would. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:18 PM |
| The game pass ID goes in the second slot, after the playerId. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:18 PM |
| in the parameter part, the second argument should be the pass id |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 25 Nov 2012 09:20 PM |
| So "then return end" all goes in the same line? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 25 Nov 2012 09:21 PM |
@yo
I know you're trying to troll, so no. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 09:22 PM |
| So post that line before the lose points? |
|
|
| Report Abuse |
|
|
| |
|