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: Problem?

Previous Thread :: Next Thread 
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:10 AM
local id = 219566324

script.Parent.MouseButton1Down:connect(function(plr)
game:GetService("MarketplaceService"):PromptPurchase(plr, id)
end)

Output

>Unable to cast value to object
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
23 Feb 2015 11:14 AM
value object is plr, plr isn't the player.
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:17 AM
Oh so what do i do?
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:20 AM
b
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
23 Feb 2015 11:20 AM
The 'plr' variable doesn't get defined as the player, it gets defined as a position coordinate of the player's mouse when they clicked it.

If this is a local script, just use local plr = game.Players.LocalPlayer,

if it's not, just do local plr = script.Parent.Parent.Parent (ect)
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:21 AM
kk ty
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
23 Feb 2015 11:21 AM
Last I recall you are getting the Character not the Player

:GetPlayerFromCharacter()


Give me 15 Robux I give you print("Give me 15k")
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:23 AM
Im not very sure how to change it but i did this but it still doesnt work
local id = 219570828
local plr = script.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Down:connect(function(plr)
game:GetService("MarketplaceService"):PromptPurchase(plr, id)
end)
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:24 AM
argh i hate doing this
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:25 AM
help
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:28 AM
HELP.
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 11:32 AM
uhhhh hulp
Report Abuse
llcoolj03 is not online. llcoolj03
Joined: 20 Nov 2011
Total Posts: 6135
23 Feb 2015 12:09 PM
HELP PLEASE
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
23 Feb 2015 12:14 PM
*sigh...*

local player = game.Players.LocalPlayer
local id = 219566324

script.Parent.MouseButton1Down:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(plr,id)
end)
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
23 Feb 2015 12:14 PM
Is this in a gui? The parameters to the function for MouseButton1Down are x and y locations of mouse, not the player.
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