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: Why is it doing this every time I respawn.

Previous Thread :: Next Thread 
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:38 PM
I have an onPlayerAdded in there, and it still does it after ever respawn.


Players = game:GetService("Players")
GamePassService = Game:GetService("GamePassService")

local PassId = 94765754
 
    Game.Players.PlayerAdded:connect(function(player)
        player.CharacterAdded:connect(function(char)
        repeat wait() until char and player
            if Game:GetService("GamePassService"):PlayerHasPass(player, PassId) then
                wait()
                player.leaderstats:findFirstChild("_Pts").Value = player.leaderstats:findFirstChild("_Pts").Value + 10
            end
        end)
    end)

Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
10 Oct 2012 08:38 PM
.CharacterAdded method
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
10 Oct 2012 08:39 PM
Players = game:GetService("Players")
GamePassService = Game:GetService("GamePassService")

local PassId = 94765754

Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:wait()
if Game:GetService("GamePassService"):PlayerHasPass(player, PassId) then
wait()
player.leaderstats:findFirstChild("_Pts").Value = player.leaderstats:findFirstChild("_Pts").Value + 10
end
end)
Report Abuse
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:41 PM
Well it doesnt work unless I have that in there...


Players = game:GetService("Players")
GamePassService = Game:GetService("GamePassService")

local PassId = 94765754
 
    Game.Players.PlayerAdded:connect(function(player)
        repeat wait() until player
            if Game:GetService("GamePassService"):PlayerHasPass(player, PassId) then
                wait()
                player.leaderstats:findFirstChild("_Pts").Value = player.leaderstats:findFirstChild("_Pts").Value + 10
            end
    end)
Report Abuse
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:42 PM
nvm, I didnt see your reply.

~Lets talk when you get more money than me!
Report Abuse
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:44 PM
lol, but yours doesnt work.

~Lets talk when you get more money than me!
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
10 Oct 2012 08:52 PM
lol for you, my scripts never work

Players = game:GetService("Players")
GamePassService = Game:GetService("GamePassService")

local PassId = 94765754

Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:wait()
if Game:GetService("GamePassService"):PlayerHasPass(player, PassId) then
wait()
repeat wait() until player:FindFirstChild("leaderstats")
player.leaderstats:findFirstChild("_Pts").Value = player.leaderstats:findFirstChild("_Pts").Value + 10
end
end)
Report Abuse
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:54 PM
My scrips never work for me either. :/

I built a game with four towers, teams, bla bla, bla bla, and it only works partially. When I try to add in maps they dont work. Anyway, I am just nor fimilar with game passes
Report Abuse
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:55 PM
OK, that works. Thanks.

~Lets talk when you get more money than me!
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
10 Oct 2012 08:55 PM
They're fairly easy to understand.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
10 Oct 2012 08:56 PM
No problem.
Report Abuse
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:59 PM
I dont understand what is wrong with the music player. I am using a working script, it is just not becoming physically visible.

~Lets talk when you get more money than me!
Report Abuse
jerryg225 is not online. jerryg225
Joined: 20 Aug 2008
Total Posts: 23187
10 Oct 2012 08:59 PM
Hey, do you have TeamV?

~Lets talk when you get more money than me!
Report Abuse
ssonigsn is not online. ssonigsn
Joined: 18 Sep 2012
Total Posts: 9
10 Oct 2012 09:19 PM
really informative blog thanks for sharing and keep posting. [url=http://www.fansgiantsshop.com/Bear_Pascoe_Jersey]Bear Pascoe Jersey[/url]
Report Abuse
leman5842 is not online. leman5842
Joined: 24 Apr 2011
Total Posts: 136
10 Oct 2012 10:04 PM
Ok i have seen ur problem so i see the problem in this script



Players = game:GetService("Players")
GamePassService = Game:GetService("GamePassService")

local PassId = 94765754

Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
repeat wait() until char and player
if Game:GetService("GamePassService"):PlayerHasPass(player, PassId) then
wait()
player.leaderstats:findFirstChild("_Pts").Value = player.leaderstats:findFirstChild("_Pts").Value + 10
end
end)
end)
I see there was a mistake in it so what u wanna do is remove the leaderstats in it then player.spawn then there u go also more scripting tutorials ask me ok. If that doesent work then u made a mistake on the script
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