How to do i make it X the value u get?

so i want to make a gui that show how much thing u got

hitbox.Touched:Connect(function(hitpart)
				if not hitpart:IsDescendantOf(char) then
					if hitpart.Parent:FindFirstChild("IsAOre") then
						local ore = hitpart.Parent
						
						if ore:FindFirstChild("Stone") then
							local hpvalue = ore:FindFirstChild("Stone")
							
							hpvalue = hpvalue - StoneDamage
							hitbox:Destroy()
							
							local choosedrop = math.random(1, 2)
							if choosedrop == 1 then
								local findstonevalue = player.Backpack:FindFirstChild("Data"):FindFirstChild("Ore"):FindFirstChild("Stone")
								if findstonevalue then
									findstonevalue.Value = findstonevalue.Value + math.random(1,3)
									
									player.PlayerGui.GotGui.ThingYouGet.Visible = true
									player.PlayerGui.GotGui.ThingYouGet.Text = hitpart.Parent.Name.. "X"
								end
							end
							
						end
						
					end
				end
			end)
1 Like

Could you elaborate? It seems you’re talking about this line:
player.PlayerGui.GotGui.ThingYouGet.Text = hitpart.Parent.Name.. "X"
do you just want it to read "X" .. hitpart.Parent.Name instead?

i was trying to make like

math.random drop and it show the thing u hitting and X how much u got

So, it would read something like “Stone (x32)?”

Try string formatting out. It would look something like:
player.PlayerGui.GotGui.ThingYouGet.Text = string.format("%s (x%d)", hitpart.Parent.Name, findstonevalue.Value)

player.PlayerGui.GotGui.ThingYouGet.Text = tostring(findstonevalue.Value).. "X"
1 Like