Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
|
| 26 Apr 2016 02:29 PM |
local passId = 405122945 --change this to your GamePass Id local marketplaceService = game:GetService("MarketplaceService") local lasersniper = game.Lighting.RedHyperLaser:Clone() marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased) if isPurchased then --if the player did pay if assetId == passId then --if what they bought is the passId lasersniper.Parent = Player.Backpack end end end)
What's wrong with it |
|
|
| Report Abuse |
|
|
Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
|
| 26 Apr 2016 02:29 PM |
| I'd appreciate if someone would help me |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 26 Apr 2016 02:55 PM |
Taken out of my game and edited!
local passId = 405122945 local lasersniper = game.Lighting.RedHyperLaser
function haspassyay(player) return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) end game.Players.PlayerAdded:connect(function(plr) if haspassyay(plr) then lasersniper:Clone().Parent = plr.Backpack end end)
Also, I don't recommend putting models into lighting or anything, it's inefficient and laggy. Use replicated storage. :)
|
|
|
| Report Abuse |
|
|
Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
|
| 26 Apr 2016 03:56 PM |
| Thanks, I really appreciate it! |
|
|
| Report Abuse |
|
|
Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
|
| 21 May 2016 11:31 AM |
One more thing, how to you make it so you get the tool back everytime you die?
sorry, I'm kinda a noob at scripting :P |
|
|
| Report Abuse |
|
|
Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
| |
|
Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
| |
|
| |
|
Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
|
| 21 May 2016 01:43 PM |
| That wont work, if someone didn't buy it, they would get it anyway |
|
|
| Report Abuse |
|
|
|
| 21 May 2016 01:44 PM |
| That's StarterPack, not StarterGear. |
|
|
| Report Abuse |
|
|
Coconutko
|
  |
| Joined: 05 Nov 2014 |
| Total Posts: 6799 |
|
|
| 21 May 2016 01:48 PM |
| Where is it? I've never seen it before |
|
|
| Report Abuse |
|
|
|
| 21 May 2016 01:49 PM |
StarterGear is created whenever a player joins a game. It's in the same location as BackPack, but unlike BackPack, if you die with a gear inside StarterGear, the Gear will be automatically cloned back into the BackPack.
http://wiki.roblox.com/index.php?title=API:Class/StarterGear |
|
|
| Report Abuse |
|
|