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: Why isnt this working

Previous Thread :: Next Thread 
spinywind is online. 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
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
18 Jan 2016 10:41 PM
output=?


Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
18 Jan 2016 10:43 PM
there is none ^^^ thats why im confused


Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
18 Jan 2016 10:57 PM
Please indent your code


Is it a local script
Report Abuse
spinywind is online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
18 Jan 2016 10:58 PM
Add some prints and see where it stops
Report Abuse
spinywind is online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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 is online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
18 Jan 2016 11:13 PM
Because you are looking for a backpack in 'Main'
Report Abuse
spinywind is online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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 is online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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 is online. 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 is online. 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
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