spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 10:35 PM |
this script is located in: script>Buy>RW1>Main>Shop>StarterGui>game
Pls help me with this it will mean a lot.
local Player = Game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.Button1Down:connect(function() a = script.Parent.Parent.Parent.Parent.Parent.Parent b = a:FindFirstChild("leaderstats") if b ~= nil then c = b:FindFirstChild("Cash") if c.Value >= 25 then c.Value = c.Value - 25 d = game.Lighting.RW1:Clone() d.Parent = script.Parent.Parent.Parent.Backpack d.Parent = script.Parent.Parent.Parent.StarterGear end end end)
|
|
|
| Report Abuse |
|
|
| |
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 10:43 PM |
there is none ^^^ thats why im confused
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 10:57 PM |
Please indent your code
Is it a local script |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 10:57 PM |
yes its a local script and i cant seem to fix it.
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 10:58 PM |
| Add some prints and see where it stops |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 11:03 PM |
it didnt work at all i guess the click is broken 2
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 11:11 PM |
There is output it says
Backpack is not a valid member of Frame
Line 13
Because you put the wrong number of parents
Also why are you doing this whenever they click the mouse instead of when they click the gui |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 11:12 PM |
this is where the script is located
his script is located in: script>Buy>RW1>Main>Shop>StarterGui>game idk why its not working
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 11:13 PM |
| Because you are looking for a backpack in 'Main' |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 11:14 PM |
how would i locate the backpack and starter gear? how many parents?
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 11:15 PM |
More than you have but why are you even trying to find the right amount of players when you can do
Player.Backpack |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 11:17 PM |
so i made one as a server script like this and it doesnt work am i missing parents?
function onClick() a = script.Parent.Parent.Parent.Parent.Parent.Parent b = a:FindFirstChild("leaderstats") if b ~= nil then c = b:FindFirstChild("Cash") if c.Value >= 25 then c.Value = c.Value - 25 d = game.Lighting.RW1:Clone() d.Parent = script.Parent.Parent.Parent.Parent.Parent.Backpack d.Parent = script.Parent.Parent.Parent.Parent.Parent.StarterGear end end end script.Parent.MouseButton1Click:connect(onClick)
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 11:22 PM |
Keep it a local script Put RW1 in ReplicatedStorage
local player = game.Players.LocalPlayer local cash, backpack, starterGear, RW1 = player:waitForChild("leaderstats"):waitForChild("Cash"), player:waitForChild("Backpack"), player:waitForChild("StarterGear"), game.ReplicatedStorage.RW1:clone()
script.Parent.MouseButton1Click:connect(function() if ((not starterGear:findFirstChild("RW1")) and (cash.Value >= 25)) then RW1:clone().Parent = backpack RW1:clone().Parent = starterGear end end) |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 11:22 PM |
i cant put in a replicated storage iv tried but the gun breaks so
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 18 Jan 2016 11:25 PM |
omg ty so much man it worked i just switched it to lighting and made it subtract the amount of cash 2
local player = game.Players.LocalPlayer local cash, backpack, starterGear, RW1 = player:waitForChild("leaderstats"):waitForChild("Cash"), player:waitForChild("Backpack"), player:waitForChild("StarterGear"), game.Lighting.RW1:clone()
script.Parent.MouseButton1Click:connect(function() if ((not starterGear:findFirstChild("RW1")) and (cash.Value >= 2500)) then cash.Value = cash.Value - 2500 RW1:clone().Parent = backpack RW1:clone().Parent = starterGear end end)
|
|
|
| Report Abuse |
|
|