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 MUY GAWD

Previous Thread :: Next Thread 
zekey101 is not online. zekey101
Joined: 08 Aug 2011
Total Posts: 2499
01 Jun 2016 03:49 AM
I just simply want the script to get players when they join, recognize if they have the game pass or not, and if they do, unlock the weapon. LIKE NOT SO HARD, BUT I CAN'T GET ANYTHING TO WORK. I even tried the wiki

--------------------
--| WaitForChild |--
--------------------

-- Waits for parent.child to exist, then returns it
local function WaitForChild(parent, childName)
assert(parent, "ERROR: WaitForChild: parent is nil")
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end

-----------------
--| Variables |--
-----------------

local GamePassService = game:GetService('GamePassService')
local PlayersService = game:GetService('Players')
local InsertService = game:GetService('InsertService')
local LightingService = game:GetService('Lighting') --TODO: Use new data store service once that exists

local GamePassIdObject = WaitForChild(script, 'GamePassId')
local ToolAssetsToLoad = WaitForChild(script, 'ToolAssetsToLoad')

local function CloneAdminTools(target)
for _, tool in pairs(AdminTools:GetChildren()) do
local toolClone = tool:Clone()
toolClone.Parent = target
end
end

local function OnPlayerAdded(player)
if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
local gui = WaitForChild(player, 'PlayerGui')
print(gui)
gui.EOTL.Frame.Ump45.LocalScript.Disabled = false
gui.EOTL.Frame.Ump45.Locked:remove()
end

end


R$ 1,871
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
01 Jun 2016 04:06 AM
your script is way too complicated. seriously, why are you making your own WaitForChild function when Roblox already has one?

local GamePassId = script:WaitForChild('GamePassId').Value
game.Players.PlayerAdded:connect(function(player)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,GamePassId) then
--do stuff
end
end)


Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
01 Jun 2016 04:07 AM
sorry, should be 'player' not 'plr'


Report Abuse
zekey101 is not online. zekey101
Joined: 08 Aug 2011
Total Posts: 2499
01 Jun 2016 04:33 AM
Thanks, kinda first time ever even touching game passes.


R$ 1,871
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