Im trying to make a chat gui, im trying to make it so my frame its y axis jumps by my math. But it doesnt and doesnt move. It clones itself and doesnt jump by how much my math tells it to. Here is my script.

local UIS = game:GetService("UserInputService")

local startingnumber = 0.2

local chatting = false
local xaxis = script.Parent.TextReplicated.YouText.Position.X


UIS.InputBegan:Connect(function(I)
	if I.KeyCode == Enum.KeyCode.Return then
		if script.Parent.ChatHere.Text == "" then
			print('no word')
		else
			print(chatting)
			if chatting == true then
			
				local ReplicatePlayerText = script.Parent.TextReplicated.YouText:Clone()
			
				ReplicatePlayerText.Parent = script.Parent.ScrollingFrame
				ReplicatePlayerText.Visible = true
				ReplicatePlayerText.Position = ReplicatePlayerText.Position+ UDim2.new(0,0,0,startingnumber-0-0.03)
				startingnumber = startingnumber+0.2
				print(startingnumber)
				print(ReplicatePlayerText.Position)
				
				print('ran')
				end
			
			
			
		
		end
	end
end)
script.Parent.ChatHere.Focused:Connect(function()
	script.Parent.ChatHere.Text = ""
	chatting = true
end)
script.Parent.ChatHere.FocusLost:Connect(function()
	script.Parent.ChatHere.Text = "           Chat Here"
	wait(1)
	chatting = false
end)

in the part replicateplayertext.position its not working any ideas why?

1 comment

0

You need to iterate through each ChatLabel, and adjust vertically by the (Y Offset + Separation Margin)