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 » Scripters
Home Search
 

Re: Game Passes

Previous Thread :: Next Thread 
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
05 Dec 2014 09:21 PM
Does FilteringEnabled cause game passes to not function normally? If so, how do I fix this?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
05 Dec 2014 09:22 PM
No, it doesn't.
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
05 Dec 2014 09:25 PM
Hmm, do you know what could be wrong with my game pass script then?

passId = 189618593

function onClicked(playerWhoClicked)
local HasPass = game:GetService("GamePassService"):PlayerHasPass(playerWhoClicked, passId)
if HasPass then
--Grow Stuff
else game:GetService("MarketplaceService"):PromptPurchase(playerWhoClicked, passId)
end

Note that I put stuff in the comment, so there's something there in the actual script. Also I know it has something to do with the gamepass because when I remove the if statement stuff still happens.
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
05 Dec 2014 09:26 PM
1. there's no clicked event
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
05 Dec 2014 09:26 PM
Forgot this, I've had it though:

game.Workspace.Part.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
05 Dec 2014 09:32 PM
put a script inside the part and just do

mps = game:GetService'MarketplaceService'
gamepassId = 000
script.Parent.ClickDetector.MouseClick:connect(function(click)
--etc
end)
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
05 Dec 2014 09:35 PM
What is the difference? I prefer having everything in one script, because it makes things with FilteringEnabled easier. (just my preference, I don't know if it actually makes a difference)

Is there any way I could do this in a LocalScript in StarterGui?
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
05 Dec 2014 09:37 PM
if you reference "workspace.Part" gl with that

you can put all those parts in a model and loop through or look into bindablevents
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
05 Dec 2014 09:42 PM
That's strange, because when I use game.Workspace.OBJECT for other things it works fine. Here's an example of what I did for something else:

local watermelonField = game.Workspace.WatermelonField

function watermelonFunction(x)
function onClicked(playerWhoClicked)
--Stuff works here
end
watermelonField["WatermelonPlot" .. x].ClickDetector.MouseClick:connect(onClicked)
end

for i=1,4 do
watermelonFunction(i)
end

I'm assuming it has something to do with the Game Pass, because when I remove the if statement everything else works fine.
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
06 Dec 2014 01:46 AM
Bump...
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
06 Dec 2014 04:14 PM
Bump... :/
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
06 Dec 2014 04:55 PM
there's going to be 99999999999999 things with the name "Part" in workspace
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
06 Dec 2014 05:36 PM
That was just an example. It's not actually named "Part"
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
06 Dec 2014 11:10 PM
I couldn't put the full script in a post, because it's way too long. That's why I made it up. Here's a tiny bit of it that I used for the gamepass (actual code (except for the comment) ):

passId = 189618593

function fertilizerFunction(x)
function onClicked(playerWhoClicked)
local HasPass = game:GetService("GamePassService"):PlayerHasPass(playerWhoClicked, passId)
if HasPass then
--Do Stuff--
else
game:GetService("MarketplaceService"):PromptPurchase(playerWhoClicked, passId)
end
end
fertilizerField["FertilizerPlot" .. x].ClickDetector.MouseClick:connect(onClicked)
end

fertilizerFunction(1)









Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
07 Dec 2014 12:22 AM
Bump...
Report Abuse
HyperProduct is not online. HyperProduct
Joined: 11 Nov 2012
Total Posts: 3362
07 Dec 2014 07:25 PM
Bump... again...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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