|
| 18 Mar 2017 08:25 PM |
It all works until i reset, what am i doing wrong?
local player = game.Players.LocalPlayer local passId = 507914790 local marketplaceService = game:GetService("MarketplaceService") local gun = game.Lighting.GUN:Clone()
function isAuthenticated(player) return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) end
script.Parent.ClickDetector.MouseClick:connect(function(player) if isAuthenticated(player) then gun.Parent = player.Backpack else game:GetService("MarketplaceService"):PromptPurchase(player, passId) end end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Mar 2017 08:33 PM |
| It keeps saying the parent property of gun is locked. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
00doggie
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 337 |
|
|
| 18 Mar 2017 10:59 PM |
dont delete the first line and have this line inside the MouseClick function
local gun = game.Lighting.GUN:Clone() |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2017 11:06 PM |
| ^ Write the new script for me please. |
|
|
| Report Abuse |
|
|
|
| 18 Mar 2017 11:09 PM |
| local player = game.Players.LocalPlayer local passId = ######### ##### ################## = ##################################### local gun = ######################### function isAuthenticated(player) return ############################################################# ####### end ############################################################### local gun = ######################### if isAuthenticated(player) then gun.Parent = player.Backpack else ############################################################ ####### end end) I don't know what this whole thread is really about but I decided to make the script for you xD Sorry if I got it wrong :/ |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Mar 2017 12:18 AM |
| doesn't work, can someone help me please? |
|
|
| Report Abuse |
|
|
00doggie
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 337 |
|
|
| 19 Mar 2017 12:23 AM |
local player = game.Players.LocalPlayer local passId = 507914790 local marketplaceService = game:GetService("MarketplaceService")
function isAuthenticated(player) return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) end
script.Parent.ClickDetector.MouseClick:connect(function(player) local gun = game.Lighting.GUN:Clone() if isAuthenticated(player) then gun.Parent = player.Backpack else game:GetService("MarketplaceService"):PromptPurchase(player,passId) gun:Destroy() end end)
maybe this will work? I added a line |
|
|
| Report Abuse |
|
|
| |
|
00doggie
|
  |
| Joined: 30 Jul 2009 |
| Total Posts: 337 |
|
|
| 19 Mar 2017 12:30 AM |
| uh ok well my last idea is that you should put the gun inside of replicatedstorage instead of lighting but after that I am completely out of ideas |
|
|
| Report Abuse |
|
|