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: Whats wrong here?

Previous Thread :: Next Thread 
Roaf99 is not online. Roaf99
Joined: 02 Nov 2014
Total Posts: 672
06 Sep 2015 11:19 AM
local passid = 293526977
local tools = {"Knife"}
local GamePassService = !!!!!!!!Game!!!!!!!!:GetService("GamePassService")
game.Players.PlayerAdded:connect(function(player)
repeat wait(0) until player.Backpack
repeat wait(0) until player.StarterGear
if GamePassService:PlayerHasPass(player, passid) then
for i = 1,#tools do
game.Lighting.Tools:FindFirstChild(tools[i]):Clone().Parent = player.Backpack
game.Lighting.Tools:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear
end
end
end)

This is supposed to work, i did everything the turtorial said and the word inbetween the !!!!! is underlined in the accual script. ( i added those in to show u)

Tnx guys!
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
06 Sep 2015 11:23 AM
PlayerHasAsset is better cuz PlayerHasPass caches
Report Abuse
Roaf99 is not online. Roaf99
Joined: 02 Nov 2014
Total Posts: 672
06 Sep 2015 11:28 AM
what do you mean by that?
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
06 Sep 2015 11:30 AM
Like it's not the reason why your script doesn't work, but playerhas asset is better.
Report Abuse
Erechtheus is not online. Erechtheus
Joined: 18 Jun 2012
Total Posts: 5261
06 Sep 2015 11:30 AM
local GamePassService = !!!!!!!!Game!!!!!!!!:GetService("GamePassService")


wat
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
06 Sep 2015 11:35 AM
Sorry it's player owns asset


local gamepass = 293526977
game.Players.PlayerAdded:connect(function(plr)
if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, gamepass)
repeat wait(0) until player.Backpack
repeat wait(0) until player.StarterGear
for i = 1,#tools do
game.Lighting.Tools:FindFirstChild(tools[i]):Clone().Parent = player.Backpack
game.Lighting.Tools:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear
else
print(plr.Name .. " doesn't own the Midnight Shades")
end
end)
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
06 Sep 2015 11:36 AM
Oops remove that's else statement
Report Abuse
AkaLua is not online. AkaLua
Joined: 27 Jul 2012
Total Posts: 526
06 Sep 2015 11:37 AM
Is it a blue underline? If so, it's because 'Game' doesn't exist unless you assign it previously

use

local GamePassService = game:GetService("GamePassService")

That may fix it, I'm not sure. If not, check output and post it here.


Personally, I'd do this (untested)

local passid = 293526977
local tools = {"Knife"}

game.Players.PlayerAdded:connect(function(player)
local stp = player:WaitForChild("StarterGear")
local bcp = player:WaitForChild("Backpack")
if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,passid)
local ltools = game.Lighting:WaitForChild("Tools")
for i = 1,tools do
if game.Lighting:FindFirstChild(tools[i]) then
ltools:FindFirstChild(tools[i]):clone().Parent = stp
ltools:FindFirstChild(tools[i]):clone().Parent = bcp
end
end

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