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 » Game Design
Home Search
 

Re: Small script help

Previous Thread :: Next Thread 
Coconutko is not online. 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 is not online. 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 is not online. 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 is not online. Coconutko
Joined: 05 Nov 2014
Total Posts: 6799
26 Apr 2016 03:56 PM
Thanks, I really appreciate it!
Report Abuse
Coconutko is not online. 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 is not online. Coconutko
Joined: 05 Nov 2014
Total Posts: 6799
21 May 2016 12:14 PM
bUMP
Report Abuse
Coconutko is not online. Coconutko
Joined: 05 Nov 2014
Total Posts: 6799
21 May 2016 01:08 PM
bUMP
Report Abuse
championbuilder is online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
21 May 2016 01:25 PM
Put it in StarterGear
Report Abuse
Coconutko is not online. 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
championbuilder is online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
21 May 2016 01:44 PM
That's StarterPack, not StarterGear.
Report Abuse
Coconutko is not online. 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
championbuilder is online. championbuilder
Joined: 20 Jan 2009
Total Posts: 13544
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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