|
| 09 Jan 2014 01:53 PM |
I made a simple script that's supposed to give the player the tool of they have the gamepass and ask the player to buy the pass if they DON'T have the pass, but it won't give me the tool.
GamePassService = game:GetService("GamePassService") MarketplaceService = game:GetService("MarketplaceService") gamepassid = 141485423 Lighting = game:GetService("Lighting") ScreenGui = script.Parent.Parent.Parent Player = game.Players.LocalPlayer Backpack = Player.Backpack item = Lighting:FindFirstChild("Powers")
function onClick() if GamePassService:PlayerHasPass(Player, gamepassid) then item:Clone().Parent = Backpack ScreenGui:remove() else MarketplaceService:PromptPurchase(player, gamepassid) end end
script.Parent.MouseButton1Down:connect(onClick) |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 09 Jan 2014 01:56 PM |
| "This item should be used with a Script (As opposed to a LocalScript) in order to work as expected in online mode." |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Jan 2014 02:02 PM |
| I tested it on the game with a regular script and it still didn't give me the tool. |
|
|
| Report Abuse |
|
|
| |
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 09 Jan 2014 02:05 PM |
| And you removed your use of "LocalPlayer" when you did that, right? |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2014 02:06 PM |
| No. It would take like 7 .Parents to do that. |
|
|
| Report Abuse |
|
|
| |
|