Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Select system help?

I don't know why this script not working automatically... Can help someone? I have 2 scripts.. First script: Selecting (example item) button

local select = script.Parent.Parent.Parent.Selected -- StringValue

function Select()
	select.Value = "Item1"
end

script.Parent.MouseButton1Down:connect(Select)

Second script: Detect selected item and config for buy button and something... (localscript)

local select = script.Parent.Selected
local Image = script.Parent.ImageLabel
local Des = script.Parent.Text
script.Parent.Selected.Changed(function(select)
	if select == "Item1" then
	Image.Image = "http://www.roblox.com/asset/?id=285779644"
	Des.Text = "Bla"
	elseif select == "Item2" then
	Image.Image = "http://www.roblox.com/asset/?id=285779644"
	Des.Text = "Bla"
end)

2 comments

0

I would always recommend not using Lua keywords as variables like table, spawn, or select as it might cause complications in the script in the future.

0

Oh, thx for that! :D

1 answer

✓ Accepted answer

Well, in script 1, your calling on select.Value right?

So wouldn't script 2 be the same way: if select.Value == 1 then

local select = script.Parent.Selected
local Image = script.Parent.ImageLabel
local Des = script.Parent.Text
script.Parent.Selected.Changed(function(select)
    if select.Value == "Item1" then
    Image.Image = "http://www.roblox.com/asset/?id=285779644"
    Des.Text = "Bla"
    elseif select.Value == "Item2" then
    Image.Image = "http://www.roblox.com/asset/?id=285779644"
    Des.Text = "Bla"
end)


2 comments

0

its stringvalue .-.

0

That doesn't matter. For any Value, you have to call on .Value (i.e VALUENAME.Value)

This discussion is preserved as it was. New answers, comments, and votes are closed.