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 » Scripting Helpers
Home Search
 

Re: Help?

Previous Thread :: Next Thread 
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 08:18 PM
function ClickColorBuy()
player = script.Parent.Parent.Parent
if player.Points.Value >= 50 then
Colors = script.Parent.ColorFrame:GetChildren()
for i=1,#Colors do
if Colors[i]:findFirstChild("MouseButton1Click")then
pur = script.Parent.Purchase
pur.Buying.Text = ("")
end
end
end
end


Colors = script.Parent.ColorFrame:GetChildren()
for i=1,#Colors do
Colors[i].MouseButton1Click:connect(ClickColorBuy)
end


What i wanted was out of the Buttons in that frame, to find the one that was clicked, then the pur.Buying.Text will Equal the Text of the clicked one... Help D:, i do not know what to do...
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 08:32 PM
Where exactly are you having trouble? Are you getting any errors?
Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 08:32 PM
Im not sure how to make that happen..
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 08:36 PM
While in your place editor, go to the top of the screen to View > Output Window

When you run your script, the output will show any errors that may have occurred in your script.
Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 08:46 PM
I know, i do not know how to make the script find the button the player clicked from the frame, There is so many buttons, and i do not want to have to make a click trigger for them all,i made an attempt but, yeah, i do not know how to make this happen.
Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 08:52 PM
Absolutely nothing can work, i guess so...
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 08:55 PM
Okay then. How about this?
______________________________________
player = script.Parent.Parent.Parent
Colors = script.Parent.ColorFrame:GetChildren()

for i = 1, #Colors do
Colors[i].MouseButton1Click:connect(function()
if player.Points.Value >= 50 then
pur = script.Parent.Purchase
pur.Buying.Text = ""
end)
end

Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 09:05 PM
Yes, but how can i make that text, be the text of the clicked one, there is a bunch of buttons, how can i make the text display the one that was clicked's text
Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 09:08 PM
Anyone......
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 09:09 PM
Oh.

pur.Buying.Text = Colors[i].Text

That SHOULD work. Sorry if I've made you impatient.
Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 09:43 PM
Thanks it worked, now i have this, and the Last part where it colors the vehicle, how can i get the Brick Color to be the backround color of the clicked one, i made an attempt, but there is no error, it just stays the same color and returns..

player = script.Parent.Parent.Parent
Colors = script.Parent.ColorFrame:GetChildren()

for i = 1, #Colors do
if Colors[i].ClassName == "TextButton" then
Colors[i].MouseButton1Click:connect(function()
pur = script.Parent.Purchase
pur.Label.Text = ("Buying "..Colors[i].Text.."")
pur.Visible = true
script.Parent.ColorFrame.Visible = false
pur.Buy.MouseButton1Click:connect(function()
if player.Points.Value >= Colors[i].Cost.Value then
player.Points.Value = player.Points.Value - Colors[i].Cost.Value
Vehicle = game.Workspace.Building:findFirstChild(""..player.Name..""..player.Vehicle.Value.."")
ColorAble = Vehicle:GetChildren()
pur.Visible = false
script.Parent.ColorFrame.Visible = true
for i = 1, #ColorAble do
if ColorAble[i]:findFirstChild("Color") then
ColorAble[i].Color.Color = Color3.new(Colors[i].BackroundColor3)
end
end
end
end)
end)
end
end
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 09:53 PM
I'm assuming that "Color" is a Color3Value?

ColorAble[i].Color.Value = Color3.new(Colors[i].BackroundColor3)

I think all you did was accidentally replace "Value" with "Color".
Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 09:55 PM
The Colorable is a Brick
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 10:08 PM
Then I believe all you need is ColorAble[i].Color
No need for the second one.
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 10:09 PM
Actually, ColorAble[i].BrickColor
Report Abuse
tehtochcoph is not online. tehtochcoph
Joined: 18 Jul 2013
Total Posts: 193
03 Aug 2013 10:15 PM
Nah, because color is a brick, and its only supose to color the brick with the name Color
Report Abuse
BrainSqueezer is not online. BrainSqueezer
Joined: 19 Aug 2009
Total Posts: 432
03 Aug 2013 10:21 PM
Ohhhh. So, change it to ColorAble[i].Color.BrickColor? I'm starting to get confused.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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