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

How do I use values in UDim values?

hi, so i'm trying to make clues around a map, and when you click on an object, it adds a clue to a gui, and everytime it does so, it has the same position values as the last one while moving .06 pixels downwards. However, this isn't working for me. Is there anything I'm missing here?

local cluename = script.TextButton
local cluetext = cluename.Value.Value
local clueadd = cluename:Clone()
local clueposition = cluename.Position.Y
local yvalue = game.ReplicatedStorage.yvalue.Value
local nextclueposition = UDim.new(yvalue,.02)
local clueposition=nextclueposition
script.Parent.MouseClick:connect(function(player)
	clueadd.Parent=(player).PlayerGui.ScreenGui.Frame.TruthBulletz.ScrollingFrame
	clueposition=nextclueposition
	yvalue=yvalue+.06
end)

1 answer

On line 3, you create a clone of the cluename object. This will only create one object, and not a new one each time. I would put line 3 below line 8, creating a new clone each time you click:

script.Parent.MouseClick:connect(function(player)
	local clueadd = cluename:Clone()

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