rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 11:42 AM |
I made a credit buying script on a surfacegui with a textbutton but when i click it, nothing happens, the id is correct and no errors on the output is on a localscript.
local ID = 25782764 local player = game.Players.LocalPlayer
function onClick() Game:GetService("MarketplaceService"):PromptPurchase(player, ID) end
script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2015 11:43 AM |
| You have to click the button... |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 11:44 AM |
| I'm clicking it, but nothing happens... |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2015 11:46 AM |
... You need www.roblox.com/assetID?. or something like that
Private Road - Residents Only |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2015 11:46 AM |
Alright, I'll be more specific: 1. Get a mouse 2. Move your cursor over the button 3. Bang left mouse button against face repeatedly until something happens |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 11:47 AM |
| What u mean? It works on a screengui but not on a surfacegui. |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
| |
|
|
| 22 Aug 2015 11:52 AM |
Don't you think that was something you should have mentioned? LocalScripts don't even run in the workspace.
Put the ScreenGui in the StarterGui, then set its Adornee property to the brick in workspace, then the localscript will run inside of it. |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 11:53 AM |
| But i want it to RUN on a surfacegui NOT on a screengui... |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
| |
|
|
| 22 Aug 2015 12:01 PM |
| I just explained what you have to do if you want to use a SurfaceGui. |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
| |
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 12:11 PM |
| I can't find Adornee... Where it is located? |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
| |
|
|
| 22 Aug 2015 12:15 PM |
http://wiki.roblox.com/index.php?title=API:Class/BillboardGui/Adornee
"Correct me if I'm wrong, but I'm normally right." -eLunate |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 12:17 PM |
| Omg anybody could help me on that script? Is urgent. |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
| |
|
iWindowz
|
  |
| Joined: 05 Jan 2013 |
| Total Posts: 1809 |
|
|
| 22 Aug 2015 12:20 PM |
If this script is in a button and it's not in a frame, there would be 2 parents. So the script would look like this..
script.Parent.Parent.Adornee = game.Workspace.PartNameHere -- has to be unique name. local ID = 25782764 local player = game.Players.LocalPlayer
function onClick() Game:GetService("MarketplaceService"):PromptPurchase(player, ID) end
script.Parent.MouseButton1Click:connect(onClick)
Script has to be located in StarterGui. |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 12:30 PM |
Dosen't work. Placed a localscript on the surfaceGui, but dosen't work. |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
|
| 22 Aug 2015 12:36 PM |
| Please guis explain well and don't make me crazy. Do i need to put it on the startergui or on the part of the surfacegui? |
|
|
| Report Abuse |
|
|
rubene45
|
  |
| Joined: 08 May 2012 |
| Total Posts: 333 |
|
| |
|