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 » Scripting Helpers
Home Search
 

Re: Whats wrong with this line of code

Previous Thread :: Next Thread 
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
21 Jun 2014 11:52 AM
repeat wait() until game.Players.LocalPlayer
local player = game.Players.LocalPlayer
tool = game.ReplicatedStorage:findFirstChild("Darkheart")-- changed that line
local passId = 159702103

script.Parent.MouseButton1Down:connect(function(
if Game:GetService("MarketPlaceService"):PlayerOwnsAsset(player, passId) then
wait(.7)
local a = tool:clone()
a.Parent = player.Backpack

end
end)



The line that has the error is

if Game:GetService("MarketPlaceService"):PlayerOwnsAsset(player, passId) then


Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
21 Jun 2014 11:53 AM
for some reason it errors if I try and post the error name
Report Abuse
Brickman2010 is not online. Brickman2010
Joined: 20 Nov 2009
Total Posts: 5547
21 Jun 2014 12:15 PM
'if Game:GetService("MarketPlaceService"):PlayerOwnsAsset(player, passId) then'

--I think it is just "MarketplaceService"
Report Abuse
RSFTheory is not online. RSFTheory
Joined: 31 Aug 2013
Total Posts: 315
21 Jun 2014 12:17 PM
Try


PlayerHasPass
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
21 Jun 2014 03:49 PM
the two suggestions did not work
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
21 Jun 2014 03:49 PM
it says it expected a name or "..."
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
21 Jun 2014 04:24 PM
Bump
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
21 Jun 2014 05:06 PM
bump
Report Abuse
Vuva is not online. Vuva
Joined: 22 Jan 2010
Total Posts: 1102
21 Jun 2014 05:15 PM
You forgot to close the parentheses on the first line of the connection.

So change this:
"script.Parent.MouseButton1Down:connect(function("
to this:
"script.Parent.MouseButton1Down:connect(function()"
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
21 Jun 2014 05:20 PM
oh thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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